[gnome-continuous-yocto/gnomeostree-3.28-rocko: 5256/8267] bitbake: fetch/git: use enumerate for ud.names



commit b079a2da3635f45479c55c3282b51a654fdea9af
Author: Christopher Larson <chris_larson mentor com>
Date:   Tue Mar 21 11:41:01 2017 -0700

    bitbake: fetch/git: use enumerate for ud.names
    
    list.index() isn't a particularly efficient operation, so keep track of our
    position via enumerate() instead, which is more pythonic as well.
    
    (Bitbake rev: dec6e90a4d27ee335e9c78aeebd277098fec94d1)
    
    Signed-off-by: Christopher Larson <chris_larson mentor com>
    Signed-off-by: Richard Purdie <richard purdie linuxfoundation org>

 bitbake/lib/bb/fetch2/git.py |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/bitbake/lib/bb/fetch2/git.py b/bitbake/lib/bb/fetch2/git.py
index 0779e80..bbd302e 100644
--- a/bitbake/lib/bb/fetch2/git.py
+++ b/bitbake/lib/bb/fetch2/git.py
@@ -173,8 +173,8 @@ class Git(FetchMethod):
         if len(branches) != len(ud.names):
             raise bb.fetch2.ParameterError("The number of name and branch parameters is not balanced", 
ud.url)
         ud.branches = {}
-        for name in ud.names:
-            branch = branches[ud.names.index(name)]
+        for pos, name in enumerate(ud.names):
+            branch = branches[pos]
             ud.branches[name] = branch
             ud.unresolvedrev[name] = branch
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]