[bitbake-devel] [PATCH 3/6] ui/crumbs/tasklistmodel: optimise find_path_for_item()
Joshua Lock
josh at linux.intel.com
Tue Aug 30 18:08:03 UTC 2011
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 at linux.intel.com>
---
lib/bb/ui/crumbs/tasklistmodel.py | 6 ++----
1 files changed, 2 insertions(+), 4 deletions(-)
diff --git a/lib/bb/ui/crumbs/tasklistmodel.py b/lib/bb/ui/crumbs/tasklistmodel.py
index 8413873..14a611f 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
--
1.7.6
More information about the bitbake-devel
mailing list