summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/data_smart.py
diff options
context:
space:
mode:
authorChristopher Larson <chris_larson@mentor.com>2013-08-27 16:27:40 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2013-08-28 00:34:13 +0100
commit092190e20b42cb38dd3f497dd6375f01fd973d66 (patch)
treeaa70265f251175f09b080d5398d7f68945305069 /bitbake/lib/bb/data_smart.py
parent9b052712efbdc6308ef756276c72141ac923cfa8 (diff)
downloadpoky-092190e20b42cb38dd3f497dd6375f01fd973d66.tar.gz
bitbake: data_smart: use a split/filter/rejoin for _remove
This is more idiomatic, and from the limited performance testing I did, is faster as well. See https://gist.github.com/kergoth/6360248 for the naive benchmark. (Bitbake rev: 1aa49226d5a2bac911feeb90e3d9f19529bc1a3e) Signed-off-by: Christopher Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb/data_smart.py')
-rw-r--r--bitbake/lib/bb/data_smart.py10
1 files changed, 3 insertions, 7 deletions
diff --git a/bitbake/lib/bb/data_smart.py b/bitbake/lib/bb/data_smart.py
index 3fb88a93df..6229fbf693 100644
--- a/bitbake/lib/bb/data_smart.py
+++ b/bitbake/lib/bb/data_smart.py
@@ -589,13 +589,9 @@ class DataSmart(MutableMapping):
589 if expand and value: 589 if expand and value:
590 value = self.expand(value, None) 590 value = self.expand(value, None)
591 if value and flag == "_content" and local_var and "_removeactive" in local_var: 591 if value and flag == "_content" and local_var and "_removeactive" in local_var:
592 for i in local_var["_removeactive"]: 592 filtered = filter(lambda v: v not in local_var["_removeactive"],
593 if " " + i + " " in value: 593 value.split(" "))
594 value = value.replace(" " + i + " ", " ") 594 value = " ".join(filtered)
595 if value.startswith(i + " "):
596 value = value[len(i + " "):]
597 if value.endswith(" " + i):
598 value = value[:-len(" " + i)]
599 return value 595 return value
600 596
601 def delVarFlag(self, var, flag, **loginfo): 597 def delVarFlag(self, var, flag, **loginfo):