aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorDongxiao Xu <dongxiao.xu@intel.com>2011-08-29 15:33:58 +0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2011-08-29 14:13:25 +0100
commit6555a77c199f41bf35460138764e03e30c56d29f (patch)
treeceec018082c571c9959f85c5581add38fd590a6a /lib
parent419b52e832f506504778d4d5957d1e77477bb513 (diff)
downloadbitbake-6555a77c199f41bf35460138764e03e30c56d29f.tar.gz
data_smart.py: make use of expand cache in getVar()
Currently if passing expand=True to getVar() function, it will pass the handling to getVarFlag(), which doesn't get any benefit from the expand cache. Call the expand() function separately in getVar() to make use of the expand cache, which can decrease the parsing time by 40%. (from current 49s to 27s) Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'lib')
-rw-r--r--lib/bb/data_smart.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/bb/data_smart.py b/lib/bb/data_smart.py
index 301f9e372..d8ba24ffd 100644
--- a/lib/bb/data_smart.py
+++ b/lib/bb/data_smart.py
@@ -268,7 +268,12 @@ class DataSmart(MutableMapping):
self.dict[var]["content"] = value
def getVar(self, var, expand=False, noweakdefault=False):
- return self.getVarFlag(var, "content", expand, noweakdefault)
+ value = self.getVarFlag(var, "content", False, noweakdefault)
+
+ # Call expand() separately to make use of the expand cache
+ if expand and value:
+ return self.expand(value, var)
+ return value
def renameVar(self, key, newkey):
"""