remove 3 redundant casts in Objects/longobject.c by orenmn · Pull Request #445 · python/cpython · GitHub
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

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

@vstinner

vstinner commented Mar 4, 2017

Copy link
Copy Markdown
Member

@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