control/controlclient: remove unused, slow, often-not-what-you-want NetworkMap.Equal

This commit is contained in:
Brad Fitzpatrick 2020-07-25 19:36:39 -07:00
parent 4970e771ab
commit be3ca5cbfd

View File

@ -5,7 +5,6 @@
package controlclient
import (
"bytes"
"encoding/json"
"fmt"
"log"
@ -55,26 +54,6 @@ type NetworkMap struct {
// TODO(crawshaw): Capabilities []tailcfg.Capability
}
func (n *NetworkMap) Equal(n2 *NetworkMap) bool {
if n == nil && n2 == nil {
return true
}
if n == nil || n2 == nil {
return false
}
// TODO(crawshaw): this is crude, but is an easy way to avoid bugs.
b, err := json.Marshal(n)
if err != nil {
panic(err)
}
b2, err := json.Marshal(n2)
if err != nil {
panic(err)
}
return bytes.Equal(b, b2)
}
func (nm NetworkMap) String() string {
return nm.Concise()
}