mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2024-11-23 20:37:12 +01:00
lib/storage: add missing break in removeDuplicateMetricIDs
This commit is contained in:
parent
ea4c828bae
commit
2444433d83
@ -2343,6 +2343,7 @@ func removeDuplicateMetricIDs(sortedMetricIDs []uint64) []uint64 {
|
||||
for _, metricID := range sortedMetricIDs[1:] {
|
||||
if prevMetricID == metricID {
|
||||
hasDuplicates = true
|
||||
break
|
||||
}
|
||||
prevMetricID = metricID
|
||||
}
|
||||
|
@ -26,6 +26,7 @@ func TestRemoveDuplicateMetricIDs(t *testing.T) {
|
||||
f([]uint64{123}, []uint64{123})
|
||||
f([]uint64{123, 123}, []uint64{123})
|
||||
f([]uint64{123, 123, 123}, []uint64{123})
|
||||
f([]uint64{123, 1234, 1235}, []uint64{123, 1234, 1235})
|
||||
f([]uint64{0, 1, 1, 2}, []uint64{0, 1, 2})
|
||||
f([]uint64{0, 0, 0, 1, 1, 2}, []uint64{0, 1, 2})
|
||||
f([]uint64{0, 1, 1, 2, 2}, []uint64{0, 1, 2})
|
||||
|
Loading…
Reference in New Issue
Block a user