diff options
author | Victor Stinner <vstinner@python.org> | 2022-11-10 22:58:07 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-11-10 22:58:07 (GMT) |
commit | 3a1dde8f29215418ec4e27fd6234cfa19a5407c6 (patch) | |
tree | 433d4efb6105ded7a5abcc0f96360731840b10aa /Objects/structseq.c | |
parent | 1960eb005e04b7ad8a91018088cfdb0646bc1ca0 (diff) | |
download | cpython-3a1dde8f29215418ec4e27fd6234cfa19a5407c6.zip cpython-3a1dde8f29215418ec4e27fd6234cfa19a5407c6.tar.gz cpython-3a1dde8f29215418ec4e27fd6234cfa19a5407c6.tar.bz2 |
gh-99300: Use Py_NewRef() in Objects/ directory (#99354)
Replace Py_INCREF() and Py_XINCREF() with Py_NewRef() and
Py_XNewRef() in C files of the Objects/ directory.
Diffstat (limited to 'Objects/structseq.c')
-rw-r--r-- | Objects/structseq.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/Objects/structseq.c b/Objects/structseq.c index 9a70133..100ccfe 100644 --- a/Objects/structseq.c +++ b/Objects/structseq.c @@ -200,8 +200,7 @@ structseq_new_impl(PyTypeObject *type, PyObject *arg, PyObject *dict) } for (i = 0; i < len; ++i) { PyObject *v = PySequence_Fast_GET_ITEM(arg, i); - Py_INCREF(v); - res->ob_item[i] = v; + res->ob_item[i] = Py_NewRef(v); } Py_DECREF(arg); for (; i < max_len; ++i) { @@ -219,8 +218,7 @@ structseq_new_impl(PyTypeObject *type, PyObject *arg, PyObject *dict) ob = Py_None; } } - Py_INCREF(ob); - res->ob_item[i] = ob; + res->ob_item[i] = Py_NewRef(ob); } _PyObject_GC_TRACK(res); |