mirror of
https://github.com/prometheus/prometheus.git
synced 2025-08-05 21:57:09 +02:00
refactor: use slices.Equal to simplify code
Signed-off-by: wellweek <xiezitai@outlook.com>
This commit is contained in:
parent
6566c5a2b3
commit
4e91f13db2
@ -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…
Reference in New Issue
Block a user