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/taskdata.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/taskdata.py')
-rw-r--r-- | bitbake/lib/bb/taskdata.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/bitbake/lib/bb/taskdata.py b/bitbake/lib/bb/taskdata.py index dc8d0668c1..fdd55ee83e 100644 --- a/bitbake/lib/bb/taskdata.py +++ b/bitbake/lib/bb/taskdata.py | |||
@@ -493,7 +493,7 @@ class TaskData: | |||
493 | dependees = self.get_dependees(targetid) | 493 | dependees = self.get_dependees(targetid) |
494 | for fnid in dependees: | 494 | for fnid in dependees: |
495 | self.fail_fnid(fnid, missing_list) | 495 | self.fail_fnid(fnid, missing_list) |
496 | for taskid in range(len(self.tasks_idepends)): | 496 | for taskid in xrange(len(self.tasks_idepends)): |
497 | idepends = self.tasks_idepends[taskid] | 497 | idepends = self.tasks_idepends[taskid] |
498 | for (idependid, idependtask) in idepends: | 498 | for (idependid, idependtask) in idepends: |
499 | if idependid == targetid: | 499 | if idependid == targetid: |
@@ -558,7 +558,7 @@ class TaskData: | |||
558 | logger.debug(3, ", ".join(self.run_names_index)) | 558 | logger.debug(3, ", ".join(self.run_names_index)) |
559 | 559 | ||
560 | logger.debug(3, "build_targets:") | 560 | logger.debug(3, "build_targets:") |
561 | for buildid in range(len(self.build_names_index)): | 561 | for buildid in xrange(len(self.build_names_index)): |
562 | target = self.build_names_index[buildid] | 562 | target = self.build_names_index[buildid] |
563 | targets = "None" | 563 | targets = "None" |
564 | if buildid in self.build_targets: | 564 | if buildid in self.build_targets: |
@@ -566,7 +566,7 @@ class TaskData: | |||
566 | logger.debug(3, " (%s)%s: %s", buildid, target, targets) | 566 | logger.debug(3, " (%s)%s: %s", buildid, target, targets) |
567 | 567 | ||
568 | logger.debug(3, "run_targets:") | 568 | logger.debug(3, "run_targets:") |
569 | for runid in range(len(self.run_names_index)): | 569 | for runid in xrange(len(self.run_names_index)): |
570 | target = self.run_names_index[runid] | 570 | target = self.run_names_index[runid] |
571 | targets = "None" | 571 | targets = "None" |
572 | if runid in self.run_targets: | 572 | if runid in self.run_targets: |
@@ -574,7 +574,7 @@ class TaskData: | |||
574 | logger.debug(3, " (%s)%s: %s", runid, target, targets) | 574 | logger.debug(3, " (%s)%s: %s", runid, target, targets) |
575 | 575 | ||
576 | logger.debug(3, "tasks:") | 576 | logger.debug(3, "tasks:") |
577 | for task in range(len(self.tasks_name)): | 577 | for task in xrange(len(self.tasks_name)): |
578 | logger.debug(3, " (%s)%s - %s: %s", | 578 | logger.debug(3, " (%s)%s - %s: %s", |
579 | task, | 579 | task, |
580 | self.fn_index[self.tasks_fnid[task]], | 580 | self.fn_index[self.tasks_fnid[task]], |