Simplify redundant Atoi error check in deduplicateIISNames

Co-authored-by: jkroepke <1560587+jkroepke@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot]
2026-08-14 16:48:17 +00:00
committed by GitHub
parent 6c83d1bbeb
commit c6da1f64d9

View File

@@ -322,10 +322,9 @@ func deduplicateIISNames[T collectorName](counterValues []T) []T {
// Determine the numeric suffix for this entry (-1 means "no suffix").
suffix := -1
if baseName != name {
// iisCounterBaseName guarantees the remainder after '#' is numeric.
if n, err := strconv.Atoi(name[len(baseName)+1:]); err == nil {
suffix = n
}
// iisCounterBaseName guarantees the remainder after '#' is numeric,
// so the error can be safely ignored here.
suffix, _ = strconv.Atoi(name[len(baseName)+1:])
}
if e, ok := seen[baseName]; ok {