* [PATCH] utils: Optimise looping in base_set_filespath
@ 2012-11-19 23:44 Richard Purdie
0 siblings, 0 replies; only message in thread
From: Richard Purdie @ 2012-11-19 23:44 UTC (permalink / raw)
To: openembedded-core
Calling split on the same expression, once per loop iteration is
inefficient and pointless, particularly in a function called by
every recipe during parsing.
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
---
diff --git a/meta/classes/utils.bbclass b/meta/classes/utils.bbclass
index 52e511f..c1de2f6 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)
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2012-11-19 23:58 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-11-19 23:44 [PATCH] utils: Optimise looping in base_set_filespath Richard Purdie
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.