mirror of
https://github.com/tailscale/tailscale.git
synced 2025-04-23 17:31:43 +00:00
ipn: use slices.Equal in another spot
Updates #8632 Change-Id: I91edd800f97eb0bf9a00866a1e39effc5e4f4e94 Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
This commit is contained in:
parent
79ff067db3
commit
fd580611bd
30
ipn/prefs.go
30
ipn/prefs.go
@ -607,9 +607,9 @@ func (p *Prefs) Equals(p2 *Prefs) bool {
|
|||||||
p.OperatorUser == p2.OperatorUser &&
|
p.OperatorUser == p2.OperatorUser &&
|
||||||
p.Hostname == p2.Hostname &&
|
p.Hostname == p2.Hostname &&
|
||||||
p.ForceDaemon == p2.ForceDaemon &&
|
p.ForceDaemon == p2.ForceDaemon &&
|
||||||
compareIPNets(p.AdvertiseRoutes, p2.AdvertiseRoutes) &&
|
slices.Equal(p.AdvertiseRoutes, p2.AdvertiseRoutes) &&
|
||||||
compareStrings(p.AdvertiseTags, p2.AdvertiseTags) &&
|
slices.Equal(p.AdvertiseTags, p2.AdvertiseTags) &&
|
||||||
compareStrings(p.AdvertiseServices, p2.AdvertiseServices) &&
|
slices.Equal(p.AdvertiseServices, p2.AdvertiseServices) &&
|
||||||
p.Persist.Equals(p2.Persist) &&
|
p.Persist.Equals(p2.Persist) &&
|
||||||
p.ProfileName == p2.ProfileName &&
|
p.ProfileName == p2.ProfileName &&
|
||||||
p.AutoUpdate.Equals(p2.AutoUpdate) &&
|
p.AutoUpdate.Equals(p2.AutoUpdate) &&
|
||||||
@ -636,30 +636,6 @@ func (ap AppConnectorPrefs) Pretty() string {
|
|||||||
return ""
|
return ""
|
||||||
}
|
}
|
||||||
|
|
||||||
func compareIPNets(a, b []netip.Prefix) bool {
|
|
||||||
if len(a) != len(b) {
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
for i := range a {
|
|
||||||
if a[i] != b[i] {
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
|
|
||||||
func compareStrings(a, b []string) bool {
|
|
||||||
if len(a) != len(b) {
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
for i := range a {
|
|
||||||
if a[i] != b[i] {
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
|
|
||||||
// NewPrefs returns the default preferences to use.
|
// NewPrefs returns the default preferences to use.
|
||||||
func NewPrefs() *Prefs {
|
func NewPrefs() *Prefs {
|
||||||
// Provide default values for options which might be missing
|
// Provide default values for options which might be missing
|
||||||
|
Loading…
x
Reference in New Issue
Block a user