Skip to content

Commit 55e970a

Browse files
hack/build-image: don't call same function many times
Don't call the same function many times when that function's value is never expected to change at this scope. Signed-off-by: John Mulligan <[email protected]>
1 parent 0cb61df commit 55e970a

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

hack/build-image

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -456,16 +456,17 @@ def add_special_tags(img, distro_qualified=True):
456456
# that certain images deserve some extra special tags. Mostly this serves
457457
# to keep us compatible with older tagging schemes from earlier versions of
458458
# the project.
459+
_host_arch = host_arch()
459460
if img.distro in [FEDORA, OPENSUSE]:
460-
if img.arch == host_arch() and img.pkg_source == DEFAULT:
461+
if img.arch == _host_arch and img.pkg_source == DEFAULT:
461462
img.additional_tags.append((LATEST, QUAL_NONE))
462-
if img.arch == host_arch() and img.pkg_source == NIGHTLY:
463+
if img.arch == _host_arch and img.pkg_source == NIGHTLY:
463464
img.additional_tags.append((NIGHTLY, QUAL_NONE))
464465
if not distro_qualified:
465466
return # skip creating "distro qualified" tags
466-
if img.arch == host_arch() and img.pkg_source == DEFAULT:
467+
if img.arch == _host_arch and img.pkg_source == DEFAULT:
467468
img.additional_tags.append((f"{img.distro}-{LATEST}", QUAL_DISTRO))
468-
if img.arch == host_arch() and img.pkg_source == NIGHTLY:
469+
if img.arch == _host_arch and img.pkg_source == NIGHTLY:
469470
img.additional_tags.append((f"{img.distro}-{NIGHTLY}", QUAL_DISTRO))
470471

471472

0 commit comments

Comments
 (0)