Remove allocations of lists before use (#1989)
* policy: remove allocs before appends in acls Signed-off-by: Kristoffer Dalby <kristoffer@tailscale.com> * notifier: make batcher tests stable/non-flaky Signed-off-by: Kristoffer Dalby <kristoffer@tailscale.com> * {db,derp,mapper}: dont allocate until append Signed-off-by: Kristoffer Dalby <kristoffer@tailscale.com> --------- Signed-off-by: Kristoffer Dalby <kristoffer@tailscale.com>
This commit is contained in:
parent
69c33658f6
commit
8f8f469c0a
7 changed files with 46 additions and 32 deletions
|
@ -943,7 +943,7 @@ func Test_listNodesInUser(t *testing.T) {
|
|||
},
|
||||
user: "mickael",
|
||||
},
|
||||
want: types.Nodes{},
|
||||
want: nil,
|
||||
},
|
||||
}
|
||||
for _, test := range tests {
|
||||
|
@ -1645,7 +1645,7 @@ func TestACLPolicy_generateFilterRules(t *testing.T) {
|
|||
name: "no-policy",
|
||||
field: field{},
|
||||
args: args{},
|
||||
want: []tailcfg.FilterRule{},
|
||||
want: nil,
|
||||
wantErr: false,
|
||||
},
|
||||
{
|
||||
|
@ -2896,7 +2896,7 @@ func Test_getFilteredByACLPeers(t *testing.T) {
|
|||
User: types.User{Name: "marc"},
|
||||
},
|
||||
},
|
||||
want: types.Nodes{},
|
||||
want: nil,
|
||||
},
|
||||
{
|
||||
// Investigating 699
|
||||
|
@ -3426,7 +3426,7 @@ func TestSSHRules(t *testing.T) {
|
|||
},
|
||||
},
|
||||
},
|
||||
want: &tailcfg.SSHPolicy{Rules: []*tailcfg.SSHRule{}},
|
||||
want: &tailcfg.SSHPolicy{Rules: nil},
|
||||
},
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue