mirror of
https://github.com/python/cpython.git
synced 2025-12-31 04:23:37 +00:00
bpo-42161: Use _PyLong_GetZero() and _PyLong_GetOne() (GH-22995)
Use _PyLong_GetZero() and _PyLong_GetOne() in Objects/ and Python/ directories.
This commit is contained in:
parent
303aac8c56
commit
c9bc290dd6
9 changed files with 68 additions and 40 deletions
|
|
@ -1,6 +1,7 @@
|
|||
/* enumerate object */
|
||||
|
||||
#include "Python.h"
|
||||
#include "pycore_long.h" // _PyLong_GetOne()
|
||||
|
||||
#include "clinic/enumobject.c.h"
|
||||
|
||||
|
|
@ -115,7 +116,7 @@ enum_next_long(enumobject *en, PyObject* next_item)
|
|||
}
|
||||
next_index = en->en_longindex;
|
||||
assert(next_index != NULL);
|
||||
stepped_up = PyNumber_Add(next_index, _PyLong_One);
|
||||
stepped_up = PyNumber_Add(next_index, _PyLong_GetOne());
|
||||
if (stepped_up == NULL) {
|
||||
Py_DECREF(next_item);
|
||||
return NULL;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue