aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorJoshua Lock <josh@linux.intel.com>2011-08-30 09:15:35 -0700
committerJoshua Lock <josh@linux.intel.com>2011-08-30 09:35:10 -0700
commitd2450536269996147a22d6eafbdf72aa62afa4f6 (patch)
treeb0393b3a60856ca4ac70692d035b1d986e4868e1 /lib
parent01ef2ab0d201f3cb3666462558c9cf485592e04f (diff)
downloadbitbake-d2450536269996147a22d6eafbdf72aa62afa4f6.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. Signed-off-by: Joshua Lock <josh@linux.intel.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/bb/ui/crumbs/tasklistmodel.py6
1 files changed, 2 insertions, 4 deletions
diff --git a/lib/bb/ui/crumbs/tasklistmodel.py b/lib/bb/ui/crumbs/tasklistmodel.py
index 8413873a2..14a611f5e 100644
--- a/lib/bb/ui/crumbs/tasklistmodel.py
+++ b/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