Skip to content

Commit

Permalink
fix: add Has method for a BTreeG[Item]
Browse files Browse the repository at this point in the history
  • Loading branch information
julienrbrt authored and gconnell committed Jun 15, 2022
1 parent e5eabf3 commit 3f48535
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions btree_generic.go
Original file line number Diff line number Diff line change
Expand Up @@ -990,6 +990,11 @@ func (t *BTree) Min() Item {
return i
}

// Has returns true if the given key is in the tree.
func (t *BTree) Has(key Item) bool {
return (*BTreeG[Item])(t).Has(key)
}

// ReplaceOrInsert adds the given item to the tree. If an item in the tree
// already equals the given one, it is removed from the tree and returned.
// Otherwise, nil is returned.
Expand Down

0 comments on commit 3f48535

Please sign in to comment.