diff options
author | Bob Foerster <robert@erafx.com> | 2010-11-20 04:39:22 +0800 |
---|---|---|
committer | Richard Purdie <rpurdie@linux.intel.com> | 2011-01-04 14:46:42 +0000 |
commit | c6328564de8e8cae113ee559d769105f9f4b6003 (patch) | |
tree | c557df9ea46a3ed9501e14829be7db0af09239a7 /bitbake/lib/bb/cooker.py | |
parent | e81fc749f34df0b6944849f217840b3a7a027af8 (diff) | |
download | openembedded-core-c6328564de8e8cae113ee559d769105f9f4b6003.tar.gz openembedded-core-c6328564de8e8cae113ee559d769105f9f4b6003.tar.bz2 openembedded-core-c6328564de8e8cae113ee559d769105f9f4b6003.tar.xz openembedded-core-c6328564de8e8cae113ee559d769105f9f4b6003.zip |
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>
Diffstat (limited to 'bitbake/lib/bb/cooker.py')
-rw-r--r-- | bitbake/lib/bb/cooker.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/bitbake/lib/bb/cooker.py b/bitbake/lib/bb/cooker.py index 33b9201e6..2e139558b 100644 --- a/bitbake/lib/bb/cooker.py +++ b/bitbake/lib/bb/cooker.py @@ -291,7 +291,7 @@ class BBCooker: depend_tree["rdepends-pkg"] = {} depend_tree["rrecs-pkg"] = {} - for task in range(len(rq.rqdata.runq_fnid)): + for task in xrange(len(rq.rqdata.runq_fnid)): taskname = rq.rqdata.runq_task[task] fnid = rq.rqdata.runq_fnid[task] fn = taskdata.fn_index[fnid] |