Skip to content

Commit

Permalink
CV fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
chillyvee committed Feb 4, 2024
1 parent 7f2eda9 commit 1abf6e7
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion export.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ func newExporterWithOptions(tree *ImmutableTree, optimistic bool) (*Exporter, er

// export exports nodes
func (e *Exporter) export(ctx context.Context) {
e.tree.root.traversePost(e.tree, true, func(node *Node) bool {
_ = e.tree.root.traversePost(e.tree, true, func(node *Node) bool {
exportNode := &ExportNode{
Key: node.key,
Value: node.value,
Expand Down
9 changes: 5 additions & 4 deletions import.go
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,9 @@ func (i *Importer) OptimisticAdd(exportNode *ExportNode) error {
}
i.batchSize++

i.sendBatchIfFull()
if err := i.sendBatchIfFull(); err != nil {
return errors.New("failed sending db write batch")
}

return nil
}
Expand Down Expand Up @@ -263,9 +265,8 @@ func (i *Importer) Commit() error {
return ErrNoImport
}

if i.optimistic {
// All keys should be already imported
} else {
// Optimistic: All keys should be already imported
if !i.optimistic {
switch len(i.stack) {
case 0:
if err := i.batch.Set(i.tree.ndb.nodeKey(GetRootKey(i.version)), []byte{}); err != nil {
Expand Down
1 change: 1 addition & 0 deletions node.go
Original file line number Diff line number Diff line change
Expand Up @@ -707,6 +707,7 @@ func (node *Node) calcBalance(t *ImmutableTree) (int, error) {
}

// traverse is a wrapper over traverseInRange when we want the whole tree
// nolint: unparam
func (node *Node) traverse(t *ImmutableTree, ascending bool, cb func(*Node) bool) bool {
return node.traverseInRange(t, nil, nil, ascending, false, false, func(node *Node) bool {
return cb(node)
Expand Down

0 comments on commit 1abf6e7

Please sign in to comment.