Skip to content
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

bpo-40889: special-case dict.items() ^ dict.items() for performance #20718

Merged
merged 10 commits into from Jun 10, 2020

Conversation

sweeneyde
Copy link
Member

@sweeneyde sweeneyde commented Jun 8, 2020

Objects/dictobject.c Outdated Show resolved Hide resolved
Co-authored-by: Inada Naoki <songofacandy@gmail.com>
Objects/dictobject.c Outdated Show resolved Hide resolved
Objects/dictobject.c Outdated Show resolved Hide resolved
Objects/dictobject.c Outdated Show resolved Hide resolved
return NULL;
}

PyObject *key = NULL, *val1 = NULL, *val2 = NULL;
Copy link
Contributor

@rhettinger rhettinger Jun 10, 2020

Choose a reason for hiding this comment

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

I generally expect these declarations to go at the top of the function (it's not required but it is the usual style in our C code).

@rhettinger
Copy link
Contributor

rhettinger commented Jun 10, 2020

Aside from the stylistic clean-ups of moving the declarations to the top of the function, this all looks fine to me. Will wait for Inada to take another look.

@methane
Copy link
Member

methane commented Jun 10, 2020

This PR doesn't check that d2 size is changed during iteration.
But it is undefined behavior and I can not find crashing case. LGTM

@methane methane merged commit 07d8112 into python:master Jun 10, 2020
4 checks passed
arun-mani-j pushed a commit to arun-mani-j/cpython that referenced this pull request Jul 21, 2020
@sweeneyde sweeneyde deleted the dictitems_xor branch Jan 25, 2022
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.

None yet

5 participants