Skip to content

Commit

Permalink
fix: remove item may changed clone btree; (i+1) children has new cow,…
Browse files Browse the repository at this point in the history
… but do not copy

Signed-off-by: zhangchuanqing1 <[email protected]>
  • Loading branch information
zhangchuanqing5658 authored and gconnell committed Aug 21, 2024
1 parent 8e29150 commit aeba20f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion btree.go
Original file line number Diff line number Diff line change
Expand Up @@ -479,7 +479,7 @@ func (n *node) growChildAndRemove(i int, item Item, minItems int, typ toRemove)
child := n.mutableChild(i)
// merge with right child
mergeItem := n.items.removeAt(i)
mergeChild := n.children.removeAt(i + 1)
mergeChild := n.children.removeAt(i + 1).mutableFor(n.cow)
child.items = append(child.items, mergeItem)
child.items = append(child.items, mergeChild.items...)
child.children = append(child.children, mergeChild.children...)
Expand Down

0 comments on commit aeba20f

Please sign in to comment.