From: Sergey Matveev Date: Mon, 14 Nov 2022 14:19:49 +0000 (+0300) Subject: Explicitly process only unique targets X-Git-Tag: v1.28.0~4 X-Git-Url: http://www.git.cypherpunks.ru/?p=goredo.git;a=commitdiff_plain;h=b813667339b846924bb87a30f0c12bc998154ff6 Explicitly process only unique targets --- diff --git a/ifchange.go b/ifchange.go index 922939b..913ddba 100644 --- a/ifchange.go +++ b/ifchange.go @@ -179,6 +179,17 @@ RebuildDeps: } func ifchange(tgts []string, forced, traced bool) (bool, error) { + // only unique elements + m := make(map[string]struct{}) + for _, t := range tgts { + m[t] = struct{}{} + } + tgts = tgts[:0] + for t := range m { + tgts = append(tgts, t) + } + m = nil + jsInit() if !IsTopRedo { defer jsAcquire("ifchange exiting")