Skip to content

Commit 58c3939

Browse files
committed
gh-158790: Address review comments
Use Sphinx roles in the NEWS entry (:meth:`list.insert`, :keyword:`del`, :manpage:`memmove(3)`) and drop a comment in ins1() that repeated the rationale already given in the commit message.
1 parent f4a13b1 commit 58c3939

2 files changed

Lines changed: 1 addition & 3 deletions

File tree

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
Speed up ``list.insert()`` and ``del list[i]`` in free-threaded builds by using ``memmove()`` to shift elements when the list is not shared.
1+
Speed up :meth:`list.insert` and item deletion via :keyword:`del` in free-threaded builds by using :manpage:`memmove(3)`.

‎Objects/listobject.c‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -509,8 +509,6 @@ ins1(PyListObject *self, Py_ssize_t where, PyObject *v)
509509
n - where);
510510
}
511511
#else
512-
/* The compiler expands this loop inline. This is faster than a
513-
memmove() call for short lists. */
514512
for (Py_ssize_t i = n; --i >= where; )
515513
FT_ATOMIC_STORE_PTR_RELEASE(items[i+1], items[i]);
516514
#endif

0 commit comments

Comments
 (0)