[oe-commits] Richard Purdie : utils: Optimise looping in base_set_filespath
git at git.openembedded.org
git at git.openembedded.org
Wed Nov 21 16:56:27 UTC 2012
Module: openembedded-core.git
Branch: master
Commit: 566c0e874fc1610f3f97737b5601ef22026c918a
URL: http://git.openembedded.org/?p=openembedded-core.git&a=commit;h=566c0e874fc1610f3f97737b5601ef22026c918a
Author: Richard Purdie <richard.purdie at linuxfoundation.org>
Date: Mon Nov 19 22:27:17 2012 +0000
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 <richard.purdie at linuxfoundation.org>
---
meta/classes/utils.bbclass | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
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)
More information about the Openembedded-commits
mailing list