Fix typo in Object/listobject.c (GH-21079)
This commit is contained in:
parent
b30ee26e36
commit
5b96370030
|
@ -176,7 +176,7 @@ convention. Patch by Dong-hee Na.
|
||||||
.. section: Core and Builtins
|
.. section: Core and Builtins
|
||||||
|
|
||||||
Chaged list overallocation strategy. It no longer overallocates if the new
|
Chaged list overallocation strategy. It no longer overallocates if the new
|
||||||
size is closer to overalocated size than to the old size and adds padding.
|
size is closer to overallocated size than to the old size and adds padding.
|
||||||
|
|
||||||
..
|
..
|
||||||
|
|
||||||
|
|
|
@ -69,7 +69,7 @@ list_resize(PyListObject *self, Py_ssize_t newsize)
|
||||||
* is PY_SSIZE_T_MAX * (9 / 8) + 6 which always fits in a size_t.
|
* is PY_SSIZE_T_MAX * (9 / 8) + 6 which always fits in a size_t.
|
||||||
*/
|
*/
|
||||||
new_allocated = ((size_t)newsize + (newsize >> 3) + 6) & ~(size_t)3;
|
new_allocated = ((size_t)newsize + (newsize >> 3) + 6) & ~(size_t)3;
|
||||||
/* Do not overallocate if the new size is closer to overalocated size
|
/* Do not overallocate if the new size is closer to overallocated size
|
||||||
* than to the old size.
|
* than to the old size.
|
||||||
*/
|
*/
|
||||||
if (newsize - Py_SIZE(self) > (Py_ssize_t)(new_allocated - newsize))
|
if (newsize - Py_SIZE(self) > (Py_ssize_t)(new_allocated - newsize))
|
||||||
|
|
Loading…
Reference in New Issue