From 30c40ae4b2d54f9c09e98e05bdddacd949eb09bc Mon Sep 17 00:00:00 2001 From: Cool Developer Date: Mon, 27 Nov 2023 09:13:15 -0500 Subject: [PATCH] writeTree --- snapshot.go | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/snapshot.go b/snapshot.go index 970074911..c9245560e 100644 --- a/snapshot.go +++ b/snapshot.go @@ -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 + } } }