summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristopher Larson <chris_larson@mentor.com>2017-03-21 11:41:01 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2017-03-22 11:35:23 +0000
commitb079a2da3635f45479c55c3282b51a654fdea9af (patch)
tree9e27a0eac7b78c9156d6fe552affcdfde6a3fe2b
parent9a6f6366799ac53168f3398cb5c8d33f0da4f870 (diff)
downloadpoky-b079a2da3635f45479c55c3282b51a654fdea9af.tar.gz
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>
-rw-r--r--bitbake/lib/bb/fetch2/git.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/bitbake/lib/bb/fetch2/git.py b/bitbake/lib/bb/fetch2/git.py
index 0779e809a3..bbd302ee78 100644
--- a/bitbake/lib/bb/fetch2/git.py
+++ b/bitbake/lib/bb/fetch2/git.py
@@ -173,8 +173,8 @@ class Git(FetchMethod):
173 if len(branches) != len(ud.names): 173 if len(branches) != len(ud.names):
174 raise bb.fetch2.ParameterError("The number of name and branch parameters is not balanced", ud.url) 174 raise bb.fetch2.ParameterError("The number of name and branch parameters is not balanced", ud.url)
175 ud.branches = {} 175 ud.branches = {}
176 for name in ud.names: 176 for pos, name in enumerate(ud.names):
177 branch = branches[ud.names.index(name)] 177 branch = branches[pos]
178 ud.branches[name] = branch 178 ud.branches[name] = branch
179 ud.unresolvedrev[name] = branch 179 ud.unresolvedrev[name] = branch
180 180