]> code.ossystems Code Review - openembedded-core.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)
committerRichard Purdie <rpurdie@linux.intel.com>
Tue, 4 Jan 2011 14:46:42 +0000 (14:46 +0000)
commitc6328564de8e8cae113ee559d769105f9f4b6003
treec557df9ea46a3ed9501e14829be7db0af09239a7
parente81fc749f34df0b6944849f217840b3a7a027af8
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.

(Bitbake rev: 73b40f06444cb877a5960b2aa66abf7dacbd88f0)

Signed-off-by: Bob Foerster <robert@erafx.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
bitbake/lib/bb/cooker.py
bitbake/lib/bb/runqueue.py
bitbake/lib/bb/taskdata.py
bitbake/lib/bb/utils.py