8000 bpo-24076: Fix reference in sum() introduced by GH-28469 by pablogsal · Pull Request #28493 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

Conversation

@pablogsal
Copy link
Member
@pablogsal pablogsal commented Sep 21, 2021

switch (Py_SIZE(item)) {
case -1: b = -(sdigit) ((PyLongObject*)item)->ob_digit[0]; break;
case 0: continue;
case 0: Py_DECREF(item); continue;
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm thinking that the "continue" warrants a comment. Inside a switch-case, a break ends a case but a continue means to go to the top of the loop. The side-by-side use of break and continue is a bit confusing (I did a double take when I first saw it); hence, my suggestion to add a comment.

Copy link
Member Author

Choose a reason for hiding this comment

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

👍

Copy link
Member Author

Choose a reason for hiding this comment

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

Agreed. I actually didn't add it before to keep the PR contained. But makes sense. I have pushed a comment in the new commit

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

0