server+lnwire: pre-allocate address slices

This commit is contained in:
Olaoluwa Osuntokun committed 2017-03-29 19:00:31 -07:00
1 parent cabaf1816b
commit afe77853b7
2 files changed
+7 -5

No files matched your search

+1 -1
View File
@@ -156,7 +156,7 @@ func newServer(listenAddrs []string, notifier chainntnfs.ChainNotifier,
// If external IP addresses have been specified, add those to the list
// of this server's addresses.
selfAddrs := make([]net.Addr, 0)
selfAddrs := make([]net.Addr, 0, len(cfg.ExternalIPs))
for _, ip := range cfg.ExternalIPs {
addr, err := net.ResolveTCPAddr("tcp", ip)
if err != nil {