summaryrefslogtreecommitdiff
path: root/lib/containers/rbtree.go
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@lukeshu.com>2023-02-05 10:03:08 -0700
committerLuke Shumaker <lukeshu@lukeshu.com>2023-02-05 21:01:58 -0700
commit0ff1d420f21101a92d8da888d491860cf0cf16cc (patch)
tree3e5715b4e4fd6619f2edddf5bab315cb9a125598 /lib/containers/rbtree.go
parent53d7fbb73869eb5defa1ca5c52b26abd346b13b9 (diff)
containers: s/Cmp/Compare/ to match the standard library
Go 1.18 added net/netip.Addr.Compare, and Go 1.20 added time.Time.Compare.
Diffstat (limited to 'lib/containers/rbtree.go')
-rw-r--r--lib/containers/rbtree.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/containers/rbtree.go b/lib/containers/rbtree.go
index 0430123..1fdb799 100644
--- a/lib/containers/rbtree.go
+++ b/lib/containers/rbtree.go
@@ -111,7 +111,7 @@ func (node *RBNode[V]) search(fn func(V) int) (exact, nearest *RBNode[V]) {
func (t *RBTree[K, V]) exactKey(key K) func(V) int {
return func(val V) int {
valKey := t.KeyFn(val)
- return key.Cmp(valKey)
+ return key.Compare(valKey)
}
}
@@ -341,7 +341,7 @@ func (t *RBTree[K, V]) Insert(val V) {
switch {
case parent == nil:
t.root = node
- case key.Cmp(t.KeyFn(parent.Value)) < 0:
+ case key.Compare(t.KeyFn(parent.Value)) < 0:
parent.Left = node
default:
parent.Right = node