Skip to content

Commit

Permalink
writeTree
Browse files Browse the repository at this point in the history
  • Loading branch information
cool-develope committed Nov 27, 2023
1 parent bb9cdc6 commit 30c40ae
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions snapshot.go
Original file line number Diff line number Diff line change
Expand Up @@ -706,13 +706,15 @@ func (snap *sqliteSnapshot) writeSnapNode(node *Node, version int64, ordinal, se
if err = snap.snapshotInsert.Exec(ordinal, version, sequence, nodeBz); err != nil {
return err
}
if node.isLeaf() {
if err = snap.leafInsert.Exec(version, ordinal, nodeBz); err != nil {
return err
}
} else {
if err = snap.treeInsert.Exec(version, sequence, nodeBz); err != nil {
return err
if snap.writeTree {
if node.isLeaf() {
if err = snap.leafInsert.Exec(version, ordinal, nodeBz); err != nil {
return err
}
} else {
if err = snap.treeInsert.Exec(version, sequence, nodeBz); err != nil {
return err
}
}
}

Expand Down

0 comments on commit 30c40ae

Please sign in to comment.