]> granicus.if.org Git - python/commitdiff
Removed duplicate test from inner loop.
authorRaymond Hettinger <python@rcn.com>
Sat, 1 Mar 2003 01:44:32 +0000 (01:44 +0000)
committerRaymond Hettinger <python@rcn.com>
Sat, 1 Mar 2003 01:44:32 +0000 (01:44 +0000)
The PyIter_Check is already performed by PyObject_GetIter.

Objects/abstract.c

index b4fbd32a872c4153fcbafae97bc79618fdba09ac..36c1608767a5a8d26b22e8ba1aa3fca4766136c0 100644 (file)
@@ -2182,12 +2182,7 @@ PyObject *
 PyIter_Next(PyObject *iter)
 {
        PyObject *result;
-       if (!PyIter_Check(iter)) {
-               PyErr_Format(PyExc_TypeError,
-                            "'%.100s' object is not an iterator",
-                            iter->ob_type->tp_name);
-               return NULL;
-       }
+       assert(PyIter_Check(iter));
        result = (*iter->ob_type->tp_iternext)(iter);
        if (result == NULL &&
            PyErr_Occurred() &&