update: only get branch object once per branch

A minor optimisation - it's not going to change between layers so get it
in the branch loop.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
This commit is contained in:
Paul Eggleton 2017-01-16 11:06:58 +13:00
parent a5a3c47b69
commit a2dbda9469

View File

@ -200,6 +200,7 @@ def main():
# they never get used during normal operation).
last_rev = {}
for branch in branches:
branchobj = utils.get_branch(branch)
for layer in layerquery:
layerupdate = LayerUpdate()
layerupdate.update = update
@ -220,8 +221,6 @@ def main():
urldir = layer.get_fetch_dir()
repodir = os.path.join(fetchdir, urldir)
branchobj = utils.get_branch(branch)
if branchobj.update_environment:
cmdprefix = branchobj.update_environment.get_command()
else: