all: sync with master; upd chlog

This commit is contained in:
Ainar Garipov
2023-02-01 15:41:34 +03:00
parent c69639c013
commit 80eb339896
344 changed files with 2793 additions and 23680 deletions

View File

@@ -9,6 +9,7 @@ import (
"strings"
"github.com/AdguardTeam/golibs/errors"
"github.com/AdguardTeam/golibs/mathutil"
"github.com/miekg/dns"
"golang.org/x/exp/slices"
)
@@ -201,7 +202,7 @@ func findRewrites(
if isWildcard(r.Domain) {
// Don't use rewrites[:0], because we need to return at least one
// item here.
rewrites = rewrites[:max(1, i)]
rewrites = rewrites[:mathutil.Max(1, i)]
break
}
@@ -209,11 +210,3 @@ func findRewrites(
return rewrites, matched
}
func max(a, b int) int {
if a > b {
return a
}
return b
}