watchtower: one append instead of appends in a loop

This commit is contained in:
Andras Banki-Horvath 2020-04-09 20:49:12 +02:00
parent ebf058a2a5
commit f3f482d9f9

View File

@ -212,9 +212,7 @@ func (w *Standalone) ListeningAddrs() []net.Addr {
// NOTE: Part of the watchtowerrpc.WatchtowerBackend interface.
func (w *Standalone) ExternalIPs() []net.Addr {
addrs := make([]net.Addr, 0, len(w.cfg.ExternalIPs))
for _, addr := range w.cfg.ExternalIPs {
addrs = append(addrs, addr)
}
addrs = append(addrs, w.cfg.ExternalIPs...)
return addrs
}