• Raymond Hettinger's avatar
    Improvements to coding for itertools.tee(): · 4514369f
    Raymond Hettinger authored
    * Add error checking code to PyList_Append() call.
    
    * Replace PyObject_CallMethod(to->outbasket, "pop", NULL) with equivalent
      in-line code.  Inlining is important here because the search for the
      pop method will occur for every element returned by the iterator.
    
    * Make tee's dealloc() a little smarter.  If the trailing iterator is
      being deallocated, then the queue data is no longer needed and can
      be freed.
    4514369f
itertoolsmodule.c 47.3 KB