summaryrefslogtreecommitdiffstats
path: root/bitbake
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:34 +0100
commitdfce2695b96ab587b8235cfab2859a874e9d2eef (patch)
tree4ecfca088f7d966de0b3b755903b77a6bdb772ed /bitbake
parent5d75eb27398ba65de8510c4be53c51966d4548be (diff)
downloadast2050-yocto-poky-dfce2695b96ab587b8235cfab2859a874e9d2eef.zip
ast2050-yocto-poky-dfce2695b96ab587b8235cfab2859a874e9d2eef.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) (Bitbake rev: 6555a77c199f41bf35460138764e03e30c56d29f) Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake')
-rw-r--r--bitbake/lib/bb/data_smart.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/bitbake/lib/bb/data_smart.py b/bitbake/lib/bb/data_smart.py
index 301f9e3..d8ba24f 100644
--- a/bitbake/lib/bb/data_smart.py
+++ b/bitbake/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):
"""
OpenPOWER on IntegriCloud