[Python-checkins] cpython: Inline PyIter_Next() matching what was done for other itertools.

raymond.hettinger python-checkins at python.org
Sun Aug 16 23:24:31 CEST 2015


https://hg.python.org/cpython/rev/b9504ac1e7e8
changeset:   97398:b9504ac1e7e8
user:        Raymond Hettinger <python at rcn.com>
date:        Sun Aug 16 14:24:20 2015 -0700
summary:
  Inline PyIter_Next() matching what was done for other itertools.

files:
  Modules/itertoolsmodule.c |  4 ++--
  1 files changed, 2 insertions(+), 2 deletions(-)


diff --git a/Modules/itertoolsmodule.c b/Modules/itertoolsmodule.c
--- a/Modules/itertoolsmodule.c
+++ b/Modules/itertoolsmodule.c
@@ -1860,7 +1860,7 @@
             return NULL;                                /* input not iterable */
         }
     }
-    item = PyIter_Next(lz->active);
+    item = (*Py_TYPE(lz->active)->tp_iternext)(lz->active);
     if (item != NULL)
         return item;
     if (PyErr_Occurred()) {
@@ -3434,7 +3434,7 @@
 {
     PyObject *val, *oldtotal, *newtotal;
 
-    val = PyIter_Next(lz->it);
+    val = (*Py_TYPE(lz->it)->tp_iternext)(lz->it);
     if (val == NULL)
         return NULL;
 

-- 
Repository URL: https://hg.python.org/cpython


More information about the Python-checkins mailing list