Skip to content

Commit 3ba5d5b

Browse files
committed
save
1 parent 2db7148 commit 3ba5d5b

File tree

1 file changed

+9
-11
lines changed

1 file changed

+9
-11
lines changed

cmd/utils/app/snapshots_cmd.go

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1116,19 +1116,17 @@ func doIntegrity(cliCtx *cli.Context) error {
11161116

11171117
skipChecks := cliCtx.String("skip-check")
11181118
if len(skipChecks) > 0 {
1119-
var finalChecks []integrity.Check
1119+
skipSet := map[integrity.Check]struct{}{}
11201120
for skipCheck := range strings.SplitSeq(skipChecks, ",") {
1121-
found := false
1122-
for _, chk := range requestedChecks {
1123-
if chk == integrity.Check(skipCheck) {
1124-
found = true
1125-
logger.Info("[integrity] skipping check", "check", chk)
1126-
break
1127-
}
1128-
}
1129-
if !found {
1130-
finalChecks = append(finalChecks, integrity.Check(skipCheck))
1121+
skipSet[integrity.Check(skipCheck)] = struct{}{}
1122+
}
1123+
var finalChecks []integrity.Check
1124+
for _, chk := range requestedChecks {
1125+
if _, skip := skipSet[chk]; skip {
1126+
logger.Info("[integrity] skipping check", "check", chk)
1127+
continue
11311128
}
1129+
finalChecks = append(finalChecks, chk)
11321130
}
11331131

11341132
requestedChecks = finalChecks

0 commit comments

Comments
 (0)