Pull request: use mathutil

Merge in DNS/adguard-home from use-mathutil to master

Squashed commit of the following:

commit cfe2c02a7bb727e81fcd91674aa777df37413a8e
Author: Eugene Burkov <E.Burkov@AdGuard.COM>
Date:   Tue Jan 24 18:12:32 2023 +0300

    all: use mathutil
This commit is contained in:
Eugene Burkov
2023-01-24 19:50:19 +03:00
parent 2ecf2a4c42
commit 99ec1d840c
10 changed files with 29 additions and 55 deletions

View File

@@ -56,7 +56,7 @@ func (rm *requestMatcher) MatchRequest(
) (res *urlfilter.DNSResult, ok bool) {
switch req.DNSType {
case dns.TypeA, dns.TypeAAAA, dns.TypePTR:
log.Debug("%s: handling the request", hostsContainerPref)
log.Debug("%s: handling the request for %s", hostsContainerPref, req.Hostname)
default:
return nil, false
}
@@ -481,9 +481,6 @@ func (hc *HostsContainer) refresh() (err error) {
}
// hc.last is nil on the first refresh, so let that one through.
//
// TODO(a.garipov): Once https://github.com/golang/go/issues/56621 is
// resolved, remove the first condition.
if hc.last != nil && maps.EqualFunc(hp.table, hc.last, (*HostsRecord).equal) {
log.Debug("%s: no changes detected", hostsContainerPref)