]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
bitbake: data: Move warning code to the first loop for performance
authorRichard Purdie <richard.purdie@linuxfoundation.org>
Mon, 25 May 2015 07:53:52 +0000 (08:53 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Tue, 26 May 2015 09:33:06 +0000 (10:33 +0100)
By doing this we can take advantage of the expansion cache before
starting write operations on the data store.

(Bitbake rev: 702b42a47904f2378dd819e7463b3206883c2651)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
bitbake/lib/bb/data.py

index 82eefef1a60dbfbc4946bd01bd2f82333f9eb76d..218998a0af0cb5ac2000379e78d27b9bba364d2c 100644 (file)
@@ -156,17 +156,17 @@ def expandKeys(alterdata, readdata = None):
         if key == ekey:
             continue
         todolist[key] = ekey
+        newval = alterdata.getVar(ekey, 0)
+        if newval:
+            val = alterdata.getVar(key, 0)
+            if val is not None and newval is not None:
+                bb.warn("Variable key %s (%s) replaces original key %s (%s)." % (key, val, ekey, newval))
 
     # These two for loops are split for performance to maximise the
     # usefulness of the expand cache
 
     for key in todolist:
         ekey = todolist[key]
-        newval = alterdata.getVar(ekey, 0)
-        if newval:
-            val = alterdata.getVar(key, 0)
-            if val is not None and newval is not None:
-                bb.warn("Variable key %s (%s) replaces original key %s (%s)." % (key, val, ekey, newval))
         alterdata.renameVar(key, ekey)
 
 def inheritFromOS(d, savedenv, permitted):