Skip to content

Minor performance tweak for deque.index() with a start argument #9440

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Sep 21, 2018
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add spaces as requested
  • Loading branch information
rhettinger committed Sep 21, 2018
commit 6b7e13eadda1c67d77c709978ec7e67c3764a96c
4 changes: 2 additions & 2 deletions Modules/_collectionsmodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -1050,10 +1050,10 @@ deque_index(dequeobject *deque, PyObject *const *args, Py_ssize_t nargs)
start = stop;
assert(0 <= start && start <= stop && stop <= Py_SIZE(deque));

for (i=0 ; i<start-BLOCKLEN ; i+=BLOCKLEN) {
for (i=0 ; i < start - BLOCKLEN ; i += BLOCKLEN) {
Copy link
Member

Choose a reason for hiding this comment

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

PEP 7 requires spaces around = and no spaces before ;.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Please use your talents to focus on something relevant. Over-aggressive interpretations of PEP 7 are waste of time.

b = b->rightlink;
}
for ( ; i<start ; i++) {
for ( ; i < start ; i++) {
index++;
if (index == BLOCKLEN) {
b = b->rightlink;
Expand Down