refactor: use slices.Equal to simplify code

Signed-off-by: wellweek <xiezitai@outlook.com>
pull/16336/head
wellweek 10 months ago committed by Ayoub Mrini
parent 6566c5a2b3
commit 4e91f13db2
  1. 10
      model/labels/labels.go

@ -250,15 +250,7 @@ func (ls Labels) WithoutEmpty() Labels {
// Equal returns whether the two label sets are equal.
func Equal(ls, o Labels) bool {
if len(ls) != len(o) {
return false
}
for i, l := range ls {
if l != o[i] {
return false
}
}
return true
return slices.Equal(ls, o)
}
// EmptyLabels returns n empty Labels value, for convenience.

Loading…
Cancel
Save