Skip to content

Commit

Permalink
fix: shrink to copying data
Browse files Browse the repository at this point in the history
  • Loading branch information
guillaumemichel committed Aug 21, 2024
1 parent 60554b3 commit 79800b4
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions kad/trie/trie.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,11 @@ func (tr *Trie[K, D]) shrink() {
tr.branch[0], tr.branch[1] = nil, nil
case b0.IsEmptyLeaf() && b1.IsNonEmptyLeaf():
tr.key = b1.key
tr.data = b1.data
tr.branch[0], tr.branch[1] = nil, nil
case b0.IsNonEmptyLeaf() && b1.IsEmptyLeaf():
tr.key = b0.key
tr.data = b0.data
tr.branch[0], tr.branch[1] = nil, nil
}
}
Expand Down

0 comments on commit 79800b4

Please sign in to comment.