summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/ui/crumbs
diff options
context:
space:
mode:
authorJoshua Lock <josh@linux.intel.com>2011-08-12 15:06:06 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2011-08-15 09:47:08 +0100
commitc82dc42d4dca89121de6e781b6cb48d5d952df55 (patch)
tree6675f25f97ebde62dec08cc057508666f3731463 /bitbake/lib/bb/ui/crumbs
parent912a33bd7e4d6ff27fe8613b79bd34cf3b84679c (diff)
downloadpoky-c82dc42d4dca89121de6e781b6cb48d5d952df55.tar.gz
bb/ui/crumbs/tasklistmodel: optimise find_path_for_item
If the item_name contains virtual/, -native or -cross it won't be present in the model. Return None early in this circumstance rather than iterating the entire model and still returning None. (Bitbake rev: aeef5a4b3999bd924e89e7738efe24f80ae94fd0) Signed-off-by: Joshua Lock <josh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb/ui/crumbs')
-rw-r--r--bitbake/lib/bb/ui/crumbs/tasklistmodel.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/bitbake/lib/bb/ui/crumbs/tasklistmodel.py b/bitbake/lib/bb/ui/crumbs/tasklistmodel.py
index 1f00f6cfb2..baf4ede4af 100644
--- a/bitbake/lib/bb/ui/crumbs/tasklistmodel.py
+++ b/bitbake/lib/bb/ui/crumbs/tasklistmodel.py
@@ -472,6 +472,11 @@ class TaskListModel(gtk.ListStore):
472 Returns the path in the model or None 472 Returns the path in the model or None
473 """ 473 """
474 def find_path_for_item(self, item_name): 474 def find_path_for_item(self, item_name):
475 # We don't include virtual/* or *-native items in the model so save a
476 # heavy iteration loop by exiting early for these items
477 if item_name.startswith("virtual/") or item_name.count('-native') or item_name.count('-cross'):
478 return None
479
475 it = self.get_iter_first() 480 it = self.get_iter_first()
476 path = None 481 path = None
477 while it: 482 while it: