Skip to content

Commit de8ae95

Browse files
committed
Use correct gen on recursive insert
1 parent 278cb8c commit de8ae95

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

trie/ctrie/ctrie.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -485,7 +485,7 @@ func (c *Ctrie) iinsert(i *iNode, entry *Entry, lev uint, parent *iNode, startGe
485485
// If the branch is an I-node, then iinsert is called recursively.
486486
in := branch.(*iNode)
487487
if startGen == in.gen {
488-
return c.iinsert(in, entry, lev+w, i, i.gen)
488+
return c.iinsert(in, entry, lev+w, i, startGen)
489489
}
490490
if gcas(i, main, &mainNode{cNode: cn.renewed(startGen, c)}, c) {
491491
return c.iinsert(i, entry, lev, parent, startGen)

0 commit comments

Comments
 (0)