util/cmpx: delete now that we're using Go 1.22

Updates #11058

Change-Id: I09dea8e86f03ec148b715efca339eab8b1f0f644
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
This commit is contained in:
Brad Fitzpatrick
2024-02-07 14:27:29 -08:00
committed by Brad Fitzpatrick
parent 5ea071186e
commit 2bd3c1474b
24 changed files with 41 additions and 92 deletions

View File

@@ -4,6 +4,7 @@
package dnscache
import (
"cmp"
"encoding/binary"
"errors"
"fmt"
@@ -13,7 +14,6 @@ import (
"github.com/golang/groupcache/lru"
"golang.org/x/net/dns/dnsmessage"
"tailscale.com/util/cmpx"
)
// MessageCache is a cache that works at the DNS message layer,
@@ -60,7 +60,7 @@ func (c *MessageCache) Flush() {
// pruneLocked prunes down the cache size to the configured (or
// default) max size.
func (c *MessageCache) pruneLocked() {
max := cmpx.Or(c.cacheSizeSet, 500)
max := cmp.Or(c.cacheSizeSet, 500)
for c.cache.Len() > max {
c.cache.RemoveOldest()
}