diff options
author | Joshua Lock <josh@linux.intel.com> | 2011-08-12 15:06:06 -0700 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2011-08-15 09:33:09 +0100 |
commit | aeef5a4b3999bd924e89e7738efe24f80ae94fd0 (patch) | |
tree | 7e892fd52a148f86f2771922286bfb42ad349390 | |
parent | 049927e99c8d1db7273fbd179b2614bd2ea9403b (diff) | |
download | bitbake-aeef5a4b3999bd924e89e7738efe24f80ae94fd0.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.
Signed-off-by: Joshua Lock <josh@linux.intel.com>
-rw-r--r-- | lib/bb/ui/crumbs/tasklistmodel.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/bb/ui/crumbs/tasklistmodel.py b/lib/bb/ui/crumbs/tasklistmodel.py index 1f00f6cfb..baf4ede4a 100644 --- a/lib/bb/ui/crumbs/tasklistmodel.py +++ b/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: |