From 0ff1d420f21101a92d8da888d491860cf0cf16cc Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Sun, 5 Feb 2023 10:03:08 -0700 Subject: 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. --- lib/containers/rbtree.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/containers/rbtree.go') 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 -- cgit v1.2.3-2-g168b