bitbake: fetch2/wget: move loop-invariant load of BB_ORIGENV

BB_ORIGENV is used as a fallback environment block. It is repeatedly
accessed inside the loop. Since it is a loop invariant, move it out of
the loop.

(Bitbake rev: 346a1a6c76d40458d7b4c116147ec4d371bee74a)

Signed-off-by: Zygmunt Krynicki <zygmunt.krynicki@huawei.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Zygmunt Krynicki
2022-02-19 17:59:46 +01:00
committed by Richard Purdie
parent 427bfd5f8f
commit 59fdcddf05

View File

@@ -316,12 +316,11 @@ class Wget(FetchMethod):
# to scope the changes to the build_opener request, which is when the
# environment lookups happen.
newenv = {}
origenv = d.getVar("BB_ORIGENV")
for name in bb.fetch2.FETCH_EXPORT_VARS:
value = d.getVar(name)
if not value:
origenv = d.getVar("BB_ORIGENV")
if origenv:
value = origenv.getVar(name)
if not value and origenv:
value = origenv.getVar(name)
if value:
newenv[name] = value