Skip to content

Commit

Permalink
chore: remove unnecessary condition (#15277)
Browse files Browse the repository at this point in the history
  • Loading branch information
julienrbrt authored Mar 6, 2023
1 parent e7097b1 commit fd76793
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 10 deletions.
6 changes: 1 addition & 5 deletions store/iavl/store.go
Original file line number Diff line number Diff line change
Expand Up @@ -281,11 +281,7 @@ func (st *Store) Export(version int64) (*iavl.Exporter, error) {
if !ok || tree == nil {
return nil, fmt.Errorf("iavl export failed: unable to fetch tree for version %v", version)
}
export, err := tree.Export()
if err != nil {
return nil, err
}
return export, nil
return tree.Export()
}

// Import imports an IAVL tree at the given version, returning an iavl.Importer for importing.
Expand Down
6 changes: 1 addition & 5 deletions store/rootmulti/store.go
Original file line number Diff line number Diff line change
Expand Up @@ -779,10 +779,6 @@ func (rs *Store) Snapshot(height uint64, protoWriter protoio.Writer) error {
for _, store := range stores {
rs.logger.Debug("starting snapshot", "store", store.name, "height", height)
exporter, err := store.Export(int64(height))
if exporter == nil {
rs.logger.Error("snapshot failed; exporter is nil", "store", store.name)
return err
}
if err != nil {
rs.logger.Error("snapshot failed; exporter error", "store", store.name, "err", err)
return err
Expand All @@ -807,7 +803,7 @@ func (rs *Store) Snapshot(height uint64, protoWriter protoio.Writer) error {
for {
node, err := exporter.Next()
if err == iavltree.ErrorExportDone {
rs.logger.Debug("Snapshot Done", "store", store.name, "nodeCount", nodeCount)
rs.logger.Debug("snapshot Done", "store", store.name, "nodeCount", nodeCount)
nodeCount = 0
break
} else if err != nil {
Expand Down

0 comments on commit fd76793

Please sign in to comment.