mirror of
https://github.com/coredns/coredns.git
synced 2025-10-27 16:24:19 -04:00
refactor: use slices.Equal to simplify code (#7426)
This commit is contained in:
@@ -13,6 +13,8 @@
|
|||||||
package fall
|
package fall
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"slices"
|
||||||
|
|
||||||
"github.com/coredns/coredns/plugin"
|
"github.com/coredns/coredns/plugin"
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -48,15 +50,7 @@ func (f *F) SetZonesFromArgs(zones []string) {
|
|||||||
|
|
||||||
// Equal returns true if f and g are equal.
|
// Equal returns true if f and g are equal.
|
||||||
func (f *F) Equal(g F) bool {
|
func (f *F) Equal(g F) bool {
|
||||||
if len(f.Zones) != len(g.Zones) {
|
return slices.Equal(f.Zones, g.Zones)
|
||||||
return false
|
|
||||||
}
|
|
||||||
for i := range f.Zones {
|
|
||||||
if f.Zones[i] != g.Zones[i] {
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return true
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Zero returns a zero valued F.
|
// Zero returns a zero valued F.
|
||||||
|
|||||||
Reference in New Issue
Block a user