utils: Optimise looping in base_set_filespath

Calling split on the same expression, once per loop iteration is
inefficent and pointless, particularly in a function called by
every recipe during parsing.

(From OE-Core rev: 566c0e874fc1610f3f97737b5601ef22026c918a)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Richard Purdie 2012-11-19 22:27:17 +00:00
parent e6b313d68e
commit 73ef532777
1 changed files with 2 additions and 2 deletions

View File

@ -308,10 +308,10 @@ def base_set_filespath(path, d):
if extrapaths != "":
path = extrapaths.split(":") + path
# The ":" ensures we have an 'empty' override
overrides = (d.getVar("OVERRIDES", True) or "") + ":"
overrides = ((d.getVar("OVERRIDES", True) or "") + ":").split(":")
for p in path:
if p != "":
for o in overrides.split(":"):
for o in overrides:
filespath.append(os.path.join(p, o))
return ":".join(filespath)