store lighthouses as a slice (#1473)

* store lighthouses as a slice. If you have fewer than 16 lighthouses (and fewer than 16 vpnaddrs on a host, I guess), it's faster
This commit is contained in:
Jack Doan 2025-09-10 09:43:25 -05:00 committed by GitHub
parent 65cc253c19
commit 8196c22b5a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 31 additions and 25 deletions

View file

@ -22,7 +22,7 @@ func newTestLighthouse() *LightHouse {
addrMap: map[netip.Addr]*RemoteList{},
queryChan: make(chan netip.Addr, 10),
}
lighthouses := map[netip.Addr]struct{}{}
lighthouses := []netip.Addr{}
staticList := map[netip.Addr]struct{}{}
lh.lighthouses.Store(&lighthouses)