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-39829: Optimize __len__() being called twice in the list() constructor #31816

Merged
merged 15 commits into from
Mar 14, 2022
Merged
Changes from 1 commit
Commits
Show all changes
15 commits
Select commit Hold shift + click to select a range
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
bpo-39829: __len__() called twice in the list() constructor
thatbirdguythatuknownot authored Mar 11, 2022

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
commit 39b88e3ddf5fbd29791a758b5ffcda7f29cea326
1 change: 0 additions & 1 deletion Objects/listobject.c
Original file line number Diff line number Diff line change
@@ -934,7 +934,6 @@ list_extend(PyListObject *self, PyObject *iterable)
*/
}
else if (self->ob_item == NULL) {
/* We have to rely on n being correct in this case. */
if (n && list_preallocate_exact(self, n) < 0)
goto error;
}