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 | poky-c6328564de8e8cae113ee559d769105f9f4b6003.tar.gz |
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 33b9201e6f..2e139558bc 100644 --- a/bitbake/lib/bb/cooker.py +++ b/bitbake/lib/bb/cooker.py | |||
@@ -291,7 +291,7 @@ class BBCooker: | |||
291 | depend_tree["rdepends-pkg"] = {} | 291 | depend_tree["rdepends-pkg"] = {} |
292 | depend_tree["rrecs-pkg"] = {} | 292 | depend_tree["rrecs-pkg"] = {} |
293 | 293 | ||
294 | for task in range(len(rq.rqdata.runq_fnid)): | 294 | for task in xrange(len(rq.rqdata.runq_fnid)): |
295 | taskname = rq.rqdata.runq_task[task] | 295 | taskname = rq.rqdata.runq_task[task] |
296 | fnid = rq.rqdata.runq_fnid[task] | 296 | fnid = rq.rqdata.runq_fnid[task] |
297 | fn = taskdata.fn_index[fnid] | 297 | fn = taskdata.fn_index[fnid] |