From bfdc8a295b09a6b890f88199e60f3a70c6be7c36 Mon Sep 17 00:00:00 2001 From: Joshua Lock Date: Tue, 30 Aug 2011 09:15:35 -0700 Subject: 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 Signed-off-by: Richard Purdie --- bitbake/lib/bb/ui/crumbs/tasklistmodel.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'bitbake') diff --git a/bitbake/lib/bb/ui/crumbs/tasklistmodel.py b/bitbake/lib/bb/ui/crumbs/tasklistmodel.py index 8413873a2c..14a611f5e4 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 -- cgit v1.2.3-54-g00ecf