Visitar URL original
gh-158592: Skip reallocation when shrinking a small list by corona10 · Pull Request #158787 · python/cpython · GitHub
Skip to content
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
nit
  • Loading branch information
corona10 committed Oct 6, 2026
commit 6cd6e2a4e2bd671546345ad9dd16a9a2491b7f65
3 changes: 1 addition & 2 deletions Objects/listobject.c
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,7 @@ static int py_list_resize(PyListObject *self, Py_ssize_t newsize);
* Note that self->ob_item may change, and even if newsize is less
* than ob_size on entry.
*
* list_resize() only handles the fast path that does not need realloc().
* Always inlining this function makes the fast path a few instructions
* Always inlining list_resize() makes the fast path a few instructions
* in each caller instead of a function call.
*/
static inline Py_ALWAYS_INLINE int
Comment thread
ZeroIntensity marked this conversation as resolved.
Expand Down
Loading