• Raymond Hettinger's avatar
    Improvements to coding for itertools.tee(): · ff573a25
    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.
    ff573a25
itertoolsmodule.c 47.3 KB