Skip to content

Commit

Permalink
address PR comments
Browse files Browse the repository at this point in the history
  • Loading branch information
edwardmack committed Jun 17, 2022
1 parent 6d45df8 commit 377feca
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 2 additions & 1 deletion lib/trie/trie.go
Original file line number Diff line number Diff line change
Expand Up @@ -969,7 +969,8 @@ func (t *Trie) deleteBranch(branch *Node, key []byte) (
}

commonPrefixLength := lenCommonPrefix(branch.Key, key)
if (commonPrefixLength + 1) > len(key) {
keyDoesNotExist := commonPrefixLength == len(key)
if keyDoesNotExist {
return branch, false, 0
}
childIndex := key[commonPrefixLength]
Expand Down
2 changes: 0 additions & 2 deletions lib/trie/trie_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3606,8 +3606,6 @@ func Test_Trie_delete(t *testing.T) {
},
}),
},
updated: false,
nodesRemoved: 0,
},
}

Expand Down

0 comments on commit 377feca

Please sign in to comment.