summaryrefslogtreecommitdiffstats
path: root/bitbake
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
parent912a33bd7e4d6ff27fe8613b79bd34cf3b84679c (diff)
downloadast2050-yocto-poky-c82dc42d4dca89121de6e781b6cb48d5d952df55.zip
ast2050-yocto-poky-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')
-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 1f00f6c..baf4ede 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):
Returns the path in the model or None
"""
def find_path_for_item(self, item_name):
+ # We don't include virtual/* or *-native items in the model so save a
+ # heavy iteration loop by exiting early for these items
+ if item_name.startswith("virtual/") or item_name.count('-native') or item_name.count('-cross'):
+ return None
+
it = self.get_iter_first()
path = None
while it:
OpenPOWER on IntegriCloud