mirror of
https://github.com/python/cpython
synced 2026-09-29 10:35:30 +03:00
replace PyXXX_Length calls with PyXXX_Size calls
This commit is contained in:
parent
6253f83b0a
commit
03657cfdb0
14 changed files with 30 additions and 29 deletions
|
|
@ -563,7 +563,7 @@ listextend(PyListObject *self, PyObject *args)
|
|||
if (!b)
|
||||
return NULL;
|
||||
|
||||
if (PyObject_Length(b) == 0)
|
||||
if (PyObject_Size(b) == 0)
|
||||
/* short circuit when b is empty */
|
||||
goto ok;
|
||||
|
||||
|
|
@ -585,7 +585,7 @@ listextend(PyListObject *self, PyObject *args)
|
|||
}
|
||||
}
|
||||
|
||||
blen = PyObject_Length(b);
|
||||
blen = PyObject_Size(b);
|
||||
|
||||
/* resize a using idiom */
|
||||
items = self->ob_item;
|
||||
|
|
|
|||
|
|
@ -759,7 +759,7 @@ string_join(PyStringObject *self, PyObject *args)
|
|||
/* From here on out, errors go through finally: for proper
|
||||
* reference count manipulations.
|
||||
*/
|
||||
seqlen = PySequence_Length(seq);
|
||||
seqlen = PySequence_Size(seq);
|
||||
if (seqlen == 1) {
|
||||
item = PySequence_Fast_GET_ITEM(seq, 0);
|
||||
Py_INCREF(item);
|
||||
|
|
|
|||
|
|
@ -2650,7 +2650,7 @@ PyObject *PyUnicode_Join(PyObject *separator,
|
|||
int sz = 100;
|
||||
int i;
|
||||
|
||||
seqlen = PySequence_Length(seq);
|
||||
seqlen = PySequence_Size(seq);
|
||||
if (seqlen < 0 && PyErr_Occurred())
|
||||
return NULL;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue