summaryrefslogtreecommitdiffstats
path: root/bitbake
diff options
context:
space:
mode:
authorJoshua Lock <josh@linux.intel.com>2011-08-30 09:15:35 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2011-08-30 21:57:14 +0100
commitbfdc8a295b09a6b890f88199e60f3a70c6be7c36 (patch)
tree40941df2c2b32c3e4dd2a16355e067f26509def6 /bitbake
parent9a047762cf6dd5dff785db6454df8b4aba499d0b (diff)
downloadast2050-yocto-poky-bfdc8a295b09a6b890f88199e60f3a70c6be7c36.zip
ast2050-yocto-poky-bfdc8a295b09a6b890f88199e60f3a70c6be7c36.tar.gz
ui/crumbs/tasklistmodel: optimise find_path_for_item()
Rather than calling get_path() for each iterated value use the get_value() method to lookup the COL_NAME value and only call get_path() for a match. This should save some time by potentially removing N-1 calls to get_path() from the loop. (Bitbake rev: d2450536269996147a22d6eafbdf72aa62afa4f6) Signed-off-by: Joshua Lock <josh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake')
-rw-r--r--bitbake/lib/bb/ui/crumbs/tasklistmodel.py6
1 files changed, 2 insertions, 4 deletions
diff --git a/bitbake/lib/bb/ui/crumbs/tasklistmodel.py b/bitbake/lib/bb/ui/crumbs/tasklistmodel.py
index 8413873..14a611f 100644
--- a/bitbake/lib/bb/ui/crumbs/tasklistmodel.py
+++ b/bitbake/lib/bb/ui/crumbs/tasklistmodel.py
@@ -481,11 +481,9 @@ class TaskListModel(gtk.ListStore):
return None
it = self.get_iter_first()
- path = None
while it:
- path = self.get_path(it)
- if (self[path][self.COL_NAME] == item_name):
- return path
+ if (self.get_value(it, self.COL_NAME) == item_name):
+ return self.get_path(it)
else:
it = self.iter_next(it)
return None
OpenPOWER on IntegriCloud