Skip to content

remove 3 redundant casts in Objects/longobject.c - #445

Merged
mdickinson merged 1 commit into
python:masterfrom
orenmn:remove-redundant-casts-in-longobject
Mar 6, 2017
Merged

remove 3 redundant casts in Objects/longobject.c#445
mdickinson merged 1 commit into
python:masterfrom
orenmn:remove-redundant-casts-in-longobject

Conversation

@orenmn

@orenmn orenmn commented Mar 3, 2017

Copy link
Copy Markdown
Contributor

ISTM that it's quite obvious that the (unsigned long) and the (unsigned long long) casts are redundant.

the (twodigits) cast is also redundant, because casting has precedence over shift left (as can be seen in http://en.cppreference.com/w/c/language/operator_precedence).

Just in case, I ran the test module on my Windows 10, with and without the patch, and as expected, it seems the patch doesn't break anything.

@mention-bot

Copy link
Copy Markdown

@orenmn, thanks for your PR! By analyzing the history of the files in this pull request, we identified @loewis, @Haypo, @mdickinson, @serhiy-storchaka and @tim-one to be potential reviewers.

@vstinner

vstinner commented Mar 4, 2017

Copy link
Copy Markdown
Member

the (twodigits) cast is also redundant, because casting has precedence over shift left (as can be seen in http://en.cppreference.com/w/c/language/operator_precedence).

I don't understand your rationale, but the cast is redundant. thisone type is twodigits and it's casted to twodigits: useless cast.

@mdickinson mdickinson left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks!

@mdickinson
mdickinson merged commit 86aa269 into python:master Mar 6, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants