btree
btree copied to clipboard
DeleteHint() equal to Delete(), intentional?
Thanks for publishing this library. It looks very nicely designed.
I noticed that in btree.go the DeleteHint() method is equivalent to Delete(), because it never passes on the hint. I wonder if this is a mistake or intended. Perhaps worth a comment in the code if this was really meant; I'm not sure why I should use hints then, if they are just ignored.
// DeleteHint deletes a value for a key using a path hint
// Returns the deleted value or nil if the key was not found.
func (tr *BTree) DeleteHint(key any, hint *PathHint) (prev any) {
if key == nil {
return nil
}
v, ok := tr.base.DeleteHint(key, nil) // <<<<<<< is this nil intentional, rather than hint?
if !ok {
return nil
}
return v
}
That looks like a mistake.