Skip to content

Commit

Permalink
review feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
gballet committed Jul 26, 2024
1 parent 4d1f76a commit b9f52b9
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion tree.go
Original file line number Diff line number Diff line change
Expand Up @@ -631,11 +631,14 @@ func (n *InternalNode) Delete(key []byte, resolver NodeResolverFn) (bool, error)
}
}

// DeleteAtStem delete a full stem. Unlike Delete, it will error out if the stem that is to
// be deleted does not exist in the tree, because it's meant to be used by rollback code,
// that should only delete things that exist.
func (n *InternalNode) DeleteAtStem(key []byte, resolver NodeResolverFn) (bool, error) {
nChild := offset2key(key, n.depth)
switch child := n.children[nChild].(type) {
case Empty:
return false, nil
return false, errDeleteMissing
case HashedNode:
if resolver == nil {
return false, errDeleteHash
Expand Down

0 comments on commit b9f52b9

Please sign in to comment.