Skip to content

Commit 7c6c9fa

Browse files
committed
rename to size_after_pop
1 parent 44a4efe commit 7c6c9fa

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

Objects/listobject.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1025,23 +1025,23 @@ list_pop_impl(PyListObject *self, Py_ssize_t index)
10251025

10261026
PyObject **items = self->ob_item;
10271027
v = items[index];
1028-
Py_ssize_t pop_after_size = Py_SIZE(self) - 1;
1029-
if(pop_after_size == 0) {
1028+
Py_ssize_t size_after_pop = Py_SIZE(self) - 1;
1029+
if(size_after_pop == 0) {
10301030
Py_INCREF(v);
10311031
status = _list_clear(self);
10321032
}
10331033
else {
1034-
if ((pop_after_size - index) > 0) {
1035-
memmove(&items[index], &items[index+1], (pop_after_size - index) * sizeof(PyObject *));
1034+
if ((size_after_pop - index) > 0) {
1035+
memmove(&items[index], &items[index+1], (size_after_pop - index) * sizeof(PyObject *));
10361036
}
1037-
status = list_resize(self, Py_SIZE(self) - 1);
1037+
status = list_resize(self, size_after_pop);
10381038
}
10391039
if (status >= 0) {
1040-
return v; // and v now owns the reference the list had
1040+
return v; // and v now owns the reference the list had
10411041
}
10421042
else {
10431043
// list resize failed, need to restore
1044-
memmove(&items[index+1], &items[index], (pop_after_size - index)* sizeof(PyObject *));
1044+
memmove(&items[index+1], &items[index], (size_after_pop - index)* sizeof(PyObject *));
10451045
items[index] = v;
10461046
return NULL;
10471047
}

0 commit comments

Comments
 (0)