From: Richard Purdie Date: Mon, 19 Nov 2012 22:27:17 +0000 (+0000) Subject: utils: Optimise looping in base_set_filespath X-Git-Tag: 2015-4~8620 X-Git-Url: https://code.ossystems.io/gitweb?a=commitdiff_plain;h=566c0e874fc1610f3f97737b5601ef22026c918a;p=openembedded-core.git 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. Signed-off-by: Richard Purdie --- diff --git a/meta/classes/utils.bbclass b/meta/classes/utils.bbclass index 52e511f5cf..c1de2f6930 100644 --- a/meta/classes/utils.bbclass +++ b/meta/classes/utils.bbclass @@ -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)