]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commit
Prefer xrange over range for small performance gain.
authorBob Foerster <robert@erafx.com>
Fri, 19 Nov 2010 20:39:22 +0000 (04:39 +0800)
committerChris Larson <chris_larson@mentor.com>
Sun, 21 Nov 2010 18:18:02 +0000 (11:18 -0700)
commit73b40f06444cb877a5960b2aa66abf7dacbd88f0
tree8d64099dfdd2d8a40a4b95276232adef81dacba6
parentbc0e147762769659b025b650b6b8da01ecf2248c
Prefer xrange over range for small performance gain.

range() allocates an actual list when called.  xrange() is just an iterator
and creates the next range item on demand.  This provides a slight
performance increase.

In python 3, range will do what xrange does currently, but the upgrade will
be handled by the 2to3 tool.

Signed-off-by: Bob Foerster <robert@erafx.com>
lib/bb/cooker.py
lib/bb/runqueue.py
lib/bb/taskdata.py
lib/bb/utils.py