From 4dc6c65656f8221bd36b91d8d21c3d862f3eac66 Mon Sep 17 00:00:00 2001 From: IceCodeNew <32576256+IceCodeNew@users.noreply.github.com> Date: Sat, 13 Sep 2025 01:05:26 +0800 Subject: [PATCH] chore: redundant function call --- handler/handler_execute.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/handler/handler_execute.go b/handler/handler_execute.go index d199f91..a7f9a97 100644 --- a/handler/handler_execute.go +++ b/handler/handler_execute.go @@ -179,11 +179,11 @@ func (h *Handler) getAssetsNoCache(q Query) (string, Assets, error) { SHA256: sumIndex[ga.Name], } + key := asset.Key() // "linux/", "/amd64" will all be assumed as "linux/amd64" if assumedLinuxAsset { - cAssetKey := asset.Key() // "linux/" always win. - if cAssetKey == "linux/" { + if key == "linux/" { delete(candidates, "/amd64") foundLinuxAMD64 = true @@ -192,11 +192,11 @@ func (h *Handler) getAssetsNoCache(q Query) (string, Assets, error) { } else if _, exists := candidates["linux/"]; exists { continue } - candidates[asset.Key()] = asset + candidates[key] = asset continue } + // there can only be 1 file for each OS/Arch - key := asset.Key() if other, exists := index[key]; exists { gnu := func(s string) bool { return strings.Contains(s, "gnu") } musl := func(s string) bool { return strings.Contains(s, "musl") }