[Python-checkins] CVS: python/dist/src/Python ceval.c,2.230.2.2,2.230.2.3
Guido van Rossum
gvanrossum@usw-pr-cvs1.sourceforge.net
Tue, 13 Mar 2001 05:53:59 -0800
Update of /cvsroot/python/python/dist/src/Python
In directory usw-pr-cvs1:/tmp/cvs-serv22229
Modified Files:
Tag: iter-branch
ceval.c
Log Message:
Oops. There was a speed-up for the common case that made no sense
with next() methods. Alas, it doesn't fix the slight performance
degradation compared to the old code.
Index: ceval.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Python/ceval.c,v
retrieving revision 2.230.2.2
retrieving revision 2.230.2.3
diff -C2 -r2.230.2.2 -r2.230.2.3
*** ceval.c 2001/03/13 13:48:21 2.230.2.2
--- ceval.c 2001/03/13 13:53:57 2.230.2.3
***************
*** 1848,1855 ****
/* before: [iter]; after: [iter, iter()] *or* [] */
v = TOP();
! if (PyIter_Check(v)) /* Speed-up common case */
! x = v->ob_type->tp_call(v, NULL, NULL);
! else
! x = PyObject_CallObject(v, NULL);
if (x == NULL) {
if (PyErr_ExceptionMatches(PyExc_IndexError)) {
--- 1848,1852 ----
/* before: [iter]; after: [iter, iter()] *or* [] */
v = TOP();
! x = PyObject_CallObject(v, NULL);
if (x == NULL) {
if (PyErr_ExceptionMatches(PyExc_IndexError)) {