diff options
author | Joshua Lock <josh@linux.intel.com> | 2011-08-30 09:15:35 -0700 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2011-08-30 21:57:14 +0100 |
commit | bfdc8a295b09a6b890f88199e60f3a70c6be7c36 (patch) | |
tree | 40941df2c2b32c3e4dd2a16355e067f26509def6 | |
parent | 9a047762cf6dd5dff785db6454df8b4aba499d0b (diff) | |
download | poky-bfdc8a295b09a6b890f88199e60f3a70c6be7c36.tar.gz |
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 <josh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r-- | bitbake/lib/bb/ui/crumbs/tasklistmodel.py | 6 |
1 files changed, 2 insertions, 4 deletions
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): | |||
481 | return None | 481 | return None |
482 | 482 | ||
483 | it = self.get_iter_first() | 483 | it = self.get_iter_first() |
484 | path = None | ||
485 | while it: | 484 | while it: |
486 | path = self.get_path(it) | 485 | if (self.get_value(it, self.COL_NAME) == item_name): |
487 | if (self[path][self.COL_NAME] == item_name): | 486 | return self.get_path(it) |
488 | return path | ||
489 | else: | 487 | else: |
490 | it = self.iter_next(it) | 488 | it = self.iter_next(it) |
491 | return None | 489 | return None |