]> code.ossystems Code Review - openembedded-core.git/commitdiff
utils: Optimise looping in base_set_filespath
authorRichard Purdie <richard.purdie@linuxfoundation.org>
Mon, 19 Nov 2012 22:27:17 +0000 (22:27 +0000)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Wed, 21 Nov 2012 16:53:46 +0000 (16:53 +0000)
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 <richard.purdie@linuxfoundation.org>
meta/classes/utils.bbclass

index 52e511f5cf354dc9cc908bad696340cad6397a01..c1de2f6930d17d0cbb18ee74f88542cfd1e54b27 100644 (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)