Pull request: 5035-slices-clone

Updates #5035.

Squashed commit of the following:

commit 9a5be90a347d4da08649927731b20fd5ecb90be2
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date:   Fri Oct 21 20:11:54 2022 +0300

    all: use slices.Clone, netip.AddrPort
This commit is contained in:
Ainar Garipov
2022-10-21 20:42:00 +03:00
parent a149d816d9
commit b86250737e
10 changed files with 35 additions and 34 deletions

View File

@@ -13,6 +13,7 @@ import (
"github.com/AdguardTeam/golibs/netutil"
"github.com/AdguardTeam/golibs/stringutil"
"github.com/miekg/dns"
"golang.org/x/exp/slices"
)
// To transfer information between modules
@@ -237,7 +238,7 @@ func (s *Server) onDHCPLeaseChanged(flags int) {
}
lowhost := strings.ToLower(l.Hostname + "." + s.localDomainSuffix)
ip := netutil.CloneIP(l.IP)
ip := slices.Clone(l.IP)
ipToHost.Set(ip, lowhost)
hostToIP[lowhost] = ip