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:56:03 +0000 (16:56 +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.

(From OE-Core rev: 566c0e874fc1610f3f97737b5601ef22026c918a)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/classes/utils.bbclass

index 52e511f..c1de2f6 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)