aboutsummaryrefslogtreecommitdiffstats
path: root/lib/bb/manifest.py
diff options
context:
space:
mode:
authorChris Larson <clarson@mvista.com>2009-06-11 13:10:04 -0700
committerChris Larson <chris_larson@mentor.com>2010-02-25 11:16:15 -0700
commit5b6ccb16c6e71e23dac6920cd2df994d67c2587b (patch)
tree6b938155a18ca31a46860b659dd374cffa38199b /lib/bb/manifest.py
parent446cc0cebd4daff7f849717f4cb89ac1b4c6b755 (diff)
downloadbitbake-5b6ccb16c6e71e23dac6920cd2df994d67c2587b.tar.gz
Avoid unnecessary calls to keys() when iterating over dictionaries.
dict objects provide an __iter__ method for the iteration which gives you the keys, so calling keys directly is unnecessary, and isn't really a best practice. The only time you really need to call the keys is if there's a danger of the dict changing out from underneith you, either due to external forces or due to modification of the iterable in the loop. Iterations over os.environ are apparently subject to such changes, so they must continue to use keys(). As an aside, also switches a couple spots to using sorted() rather than creating a temporary list with keys() and sorting that. Signed-off-by: Chris Larson <clarson@mvista.com>
Diffstat (limited to 'lib/bb/manifest.py')
-rw-r--r--lib/bb/manifest.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/bb/manifest.py b/lib/bb/manifest.py
index 4e4b7d98e..418367759 100644
--- a/lib/bb/manifest.py
+++ b/lib/bb/manifest.py
@@ -96,7 +96,7 @@ def mangle (func, line, d):
varmap["${datadir}"] = "${STAGING_DATADIR}"
matched = 0
- for key in varmap.keys():
+ for key in varmap:
if dest.startswith(key):
dest = varmap[key] + "/" + dest[len(key):]
matched = 1