[Python-checkins] bpo-36063: Minor performance tweak in long_divmod(). (GH-11915)

Serhiy Storchaka webhook-mailer at python.org
Thu Feb 21 05:01:14 EST 2019


https://github.com/python/cpython/commit/ea6207d593832fe50dbca39e94c138abbd5d266d
commit: ea6207d593832fe50dbca39e94c138abbd5d266d
branch: master
author: Sergey Fedoseev <fedoseev.sergey at gmail.com>
committer: Serhiy Storchaka <storchaka at gmail.com>
date: 2019-02-21T12:01:11+02:00
summary:

bpo-36063: Minor performance tweak in long_divmod(). (GH-11915)

files:
M Objects/longobject.c

diff --git a/Objects/longobject.c b/Objects/longobject.c
index 3c98385f5396..d7b01cebac85 100644
--- a/Objects/longobject.c
+++ b/Objects/longobject.c
@@ -4103,8 +4103,8 @@ long_divmod(PyObject *a, PyObject *b)
     }
     z = PyTuple_New(2);
     if (z != NULL) {
-        PyTuple_SetItem(z, 0, (PyObject *) div);
-        PyTuple_SetItem(z, 1, (PyObject *) mod);
+        PyTuple_SET_ITEM(z, 0, (PyObject *) div);
+        PyTuple_SET_ITEM(z, 1, (PyObject *) mod);
     }
     else {
         Py_DECREF(div);



More information about the Python-checkins mailing list