Get out faster on nil udpAddr (#449)

This commit is contained in:
Nathan Brown
2021-04-26 20:21:47 -05:00
committed by GitHub
parent 6f37280e8e
commit df7c7eec4a
3 changed files with 17 additions and 1 deletions

View File

@@ -99,6 +99,10 @@ func (r *RemoteList) ForEach(preferredRanges []*net.IPNet, forEach forEachFunc)
// CopyAddrs locks and makes a deep copy of the deduplicated address list
// The deduplication work may need to occur here, so you must pass preferredRanges
func (r *RemoteList) CopyAddrs(preferredRanges []*net.IPNet) []*udpAddr {
if r == nil {
return nil
}
r.Rebuild(preferredRanges)
r.RLock()