mirror of
https://github.com/tailscale/tailscale.git
synced 2025-08-11 21:27:31 +00:00
types/netmap: move some mutations earlier, remove, document some fields
And optimize the Persist setting a bit, allocating later and only mutating fields when there's been a Node change. Updates #1909 Change-Id: Iaddfd9e88ef76e1d18e8d0a41926eb44d0955312 Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
This commit is contained in:

committed by
Brad Fitzpatrick

parent
21170fb175
commit
165f0116f1
@@ -446,10 +446,11 @@ func TestNetmapForResponse(t *testing.T) {
|
||||
ComputedNameWithHost: "foo",
|
||||
}
|
||||
ms := newTestMapSession(t)
|
||||
|
||||
nm1 := ms.netmapForResponse(&tailcfg.MapResponse{
|
||||
mapRes := &tailcfg.MapResponse{
|
||||
Node: someNode,
|
||||
})
|
||||
}
|
||||
initDisplayNames(mapRes.Node.View(), mapRes)
|
||||
nm1 := ms.netmapForResponse(mapRes)
|
||||
if nm1.SelfNode == nil {
|
||||
t.Fatal("nil Node in 1st netmap")
|
||||
}
|
||||
|
Reference in New Issue
Block a user