fix: azure modernize part number loop check

The part number loop check can be simplified with slices.Contains.
This commit is contained in:
Ben McClelland
2026-03-03 08:58:31 -08:00
parent 271313b036
commit afbeb7cb6e
+2 -7
View File
@@ -28,6 +28,7 @@ import (
"net/url"
"os"
"path/filepath"
"slices"
"sort"
"strconv"
"strings"
@@ -2225,13 +2226,7 @@ func (az *Azure) trackZeroBytePart(ctx context.Context, bucket, key, uploadId st
// Deduplicate: replace an existing entry for the same partNumber.
parts := parseZeroByteParts(meta)
found := false
for _, p := range parts {
if p == partNumber {
found = true
break
}
}
found := slices.Contains(parts, partNumber)
if !found {
parts = append(parts, partNumber)
}