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>
This commit is contained in:
parent
9b052712ef
commit
092190e20b
|
@ -589,13 +589,9 @@ class DataSmart(MutableMapping):
|
||||||
if expand and value:
|
if expand and value:
|
||||||
value = self.expand(value, None)
|
value = self.expand(value, None)
|
||||||
if value and flag == "_content" and local_var and "_removeactive" in local_var:
|
if value and flag == "_content" and local_var and "_removeactive" in local_var:
|
||||||
for i in local_var["_removeactive"]:
|
filtered = filter(lambda v: v not in local_var["_removeactive"],
|
||||||
if " " + i + " " in value:
|
value.split(" "))
|
||||||
value = value.replace(" " + i + " ", " ")
|
value = " ".join(filtered)
|
||||||
if value.startswith(i + " "):
|
|
||||||
value = value[len(i + " "):]
|
|
||||||
if value.endswith(" " + i):
|
|
||||||
value = value[:-len(" " + i)]
|
|
||||||
return value
|
return value
|
||||||
|
|
||||||
def delVarFlag(self, var, flag, **loginfo):
|
def delVarFlag(self, var, flag, **loginfo):
|
||||||
|
|
Loading…
Reference in New Issue