diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2012-06-27 11:04:06 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2012-06-28 16:32:57 +0100 |
commit | edfb2ba32c5075e2df338a549021c634659f3225 (patch) | |
tree | d70d1d5e36362ae3c14ca7e05f86df11e67b5a73 /bitbake/lib/bb/taskdata.py | |
parent | d498bd6bf34c6dd65e24ec32d425742f42152cae (diff) | |
download | poky-edfb2ba32c5075e2df338a549021c634659f3225.tar.gz |
bitbake: taskdata: Add gettask_id_fromfnid helper function
This is like gettask_id but doesn't require translation of fnid -> fn
first which the function then translates back. This gives a sizeable
performance improvement since a significant number of lookups are avoided.
(Bitbake rev: 3190cb83e2af195a464f669c5aa8aedbf795160e)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb/taskdata.py')
-rw-r--r-- | bitbake/lib/bb/taskdata.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/bitbake/lib/bb/taskdata.py b/bitbake/lib/bb/taskdata.py index 8bc447c11c..55cdde553b 100644 --- a/bitbake/lib/bb/taskdata.py +++ b/bitbake/lib/bb/taskdata.py | |||
@@ -116,6 +116,16 @@ class TaskData: | |||
116 | ids.append(self.tasks_lookup[fnid][task]) | 116 | ids.append(self.tasks_lookup[fnid][task]) |
117 | return ids | 117 | return ids |
118 | 118 | ||
119 | def gettask_id_fromfnid(self, fnid, task): | ||
120 | """ | ||
121 | Return an ID number for the task matching fnid and task. | ||
122 | """ | ||
123 | if fnid in self.tasks_lookup: | ||
124 | if task in self.tasks_lookup[fnid]: | ||
125 | return self.tasks_lookup[fnid][task] | ||
126 | |||
127 | return None | ||
128 | |||
119 | def gettask_id(self, fn, task, create = True): | 129 | def gettask_id(self, fn, task, create = True): |
120 | """ | 130 | """ |
121 | Return an ID number for the task matching fn and task. | 131 | Return an ID number for the task matching fn and task. |