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 | ast2050-yocto-poky-edfb2ba32c5075e2df338a549021c634659f3225.zip ast2050-yocto-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 8bc447c..55cdde5 100644 --- a/bitbake/lib/bb/taskdata.py +++ b/bitbake/lib/bb/taskdata.py @@ -116,6 +116,16 @@ class TaskData: ids.append(self.tasks_lookup[fnid][task]) return ids + def gettask_id_fromfnid(self, fnid, task): + """ + Return an ID number for the task matching fnid and task. + """ + if fnid in self.tasks_lookup: + if task in self.tasks_lookup[fnid]: + return self.tasks_lookup[fnid][task] + + return None + def gettask_id(self, fn, task, create = True): """ Return an ID number for the task matching fn and task. |