]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
data_smart: use the expand_cache in VariableParse
authorRichard Purdie <richard.purdie@linuxfoundation.org>
Mon, 16 Sep 2013 07:25:08 +0000 (07:25 +0000)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Tue, 17 Sep 2013 13:09:37 +0000 (14:09 +0100)
When in VariableParse, use the expand_cache if possible rather than looking
up data. Ultimately it would come from the same place but this short cuts
a heavily used code block for speed improvements.

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

index 9be5d5e270c6d95462d14b1b49416005b0af4519..a6a4b6c8ae187beae116ef5449c1b98754a0a9a7 100644 (file)
@@ -94,6 +94,11 @@ class VariableParse:
             if self.varname and key:
                 if self.varname == key:
                     raise Exception("variable %s references itself!" % self.varname)
+            if key in self.d.expand_cache:
+                varparse = self.d.expand_cache[key]
+                self.references |= varparse.references
+                self.execs |= varparse.execs
+                return varparse.value
             var = self.d.getVar(key, True)
             if var is not None:
                 self.references.add(key)