mirror of
https://github.com/tailscale/tailscale.git
synced 2025-08-11 21:27:31 +00:00
ipn/ipnstate: address TODO about garbage during peer sorting
Updates #cleanup Change-Id: I34938bca70a95571cc62ce1f76eaab5db8c2c3ef Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
This commit is contained in:

committed by
Brad Fitzpatrick

parent
60e9bd6047
commit
d506a55c8a
@@ -168,6 +168,12 @@ func (p NodePublic) Shard() uint8 {
|
||||
return s ^ uint8(p.k[2]+p.k[12])
|
||||
}
|
||||
|
||||
// Compare returns -1, 0, or 1, depending on whether p orders before p2,
|
||||
// using bytes.Compare on the bytes of the public key.
|
||||
func (p NodePublic) Compare(p2 NodePublic) int {
|
||||
return bytes.Compare(p.k[:], p2.k[:])
|
||||
}
|
||||
|
||||
// ParseNodePublicUntyped parses an untyped 64-character hex value
|
||||
// as a NodePublic.
|
||||
//
|
||||
|
Reference in New Issue
Block a user