]> granicus.if.org Git - python/commit
Issue #24221: Small optimizations for heapq.
authorRaymond Hettinger <python@rcn.com>
Fri, 22 May 2015 07:41:57 +0000 (00:41 -0700)
committerRaymond Hettinger <python@rcn.com>
Fri, 22 May 2015 07:41:57 +0000 (00:41 -0700)
commit5cbd8331ff567ee568713dc5e63820ffb453ac4b
treec1b75bc79b07dead4ee4ec38c06c7596be5c8233
parent35e24a50c569a822c3379ba05714d9bffa3550e5
Issue #24221:  Small optimizations for heapq.

Replaces the PyList_GET_ITEM and PyList_SET_ITEM macros with normal array
accesses.  Replace the siftup unpredicatable branch with arithmetic.
Replace the rc == -1 tests with rc < 0.  Gives nicer looking assembly
with both Clang and GCC-4.9.  Also gives a small performance both for both.
Include/listobject.h
Modules/_heapqmodule.c