summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/data.py
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2013-09-16 07:33:48 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2013-09-17 14:11:04 +0100
commit36b4fcde7a24ccefe0dabcbe5e8e6712187ff679 (patch)
treeedfb0c8557fea78e4371ae6960997e30b0671fbc /bitbake/lib/bb/data.py
parentf78db82e1aed5d8eefe03c57eb96fd14b44f52b7 (diff)
downloadpoky-36b4fcde7a24ccefe0dabcbe5e8e6712187ff679.tar.gz
poky-36b4fcde7a24ccefe0dabcbe5e8e6712187ff679.tar.bz2
poky-36b4fcde7a24ccefe0dabcbe5e8e6712187ff679.zip
bitbake: data: Use direct iteration, not keys()
Profiling shows the creation of keys() has overhead and we're better using an iterator rather than the memory associated with the huge list of keys when iterating the whoe datastore. We minimise the number of times we do this to twice only per recipe. (Bitbake rev: e63448d9ee331b0f45fb9a0197d0dbee49eb2fa0) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb/data.py')
-rw-r--r--bitbake/lib/bb/data.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/bitbake/lib/bb/data.py b/bitbake/lib/bb/data.py
index e6d523210c..beaf089601 100644
--- a/bitbake/lib/bb/data.py
+++ b/bitbake/lib/bb/data.py
@@ -148,7 +148,7 @@ def expandKeys(alterdata, readdata = None):
readdata = alterdata
todolist = {}
- for key in keys(alterdata):
+ for key in alterdata:
if not '${' in key:
continue
@@ -341,7 +341,7 @@ def build_dependencies(key, keys, shelldeps, vardepvals, d):
def generate_dependencies(d):
- keys = set(key for key in d.keys() if not key.startswith("__"))
+ keys = set(key for key in d if not key.startswith("__"))
shelldeps = set(key for key in keys if d.getVarFlag(key, "export") and not d.getVarFlag(key, "unexport"))
vardepvals = set(key for key in keys if d.getVarFlag(key, "vardepvalue"))