Skip to content
This repository was archived by the owner on Oct 24, 2025. It is now read-only.

Commit 3f48535

Browse files
julienrbrtgconnell
authored andcommitted
fix: add Has method for a BTreeG[Item]
1 parent e5eabf3 commit 3f48535

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

btree_generic.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -990,6 +990,11 @@ func (t *BTree) Min() Item {
990990
return i
991991
}
992992

993+
// Has returns true if the given key is in the tree.
994+
func (t *BTree) Has(key Item) bool {
995+
return (*BTreeG[Item])(t).Has(key)
996+
}
997+
993998
// ReplaceOrInsert adds the given item to the tree. If an item in the tree
994999
// already equals the given one, it is removed from the tree and returned.
9951000
// Otherwise, nil is returned.

0 commit comments

Comments
 (0)