Skip to content

Commit

Permalink
[fixup] adds optimize comment to save function
Browse files Browse the repository at this point in the history
  • Loading branch information
dylanlott committed Jul 20, 2023
1 parent 6da5a73 commit c9caaa3
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions persistence/trees/trees.go
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,8 @@ func (t *treeStore) Rollback() {

// save commits any pending changes to the trees and serializes the treeStore to a WorldState object
// with new readers and writers.
// OPTIMIZE: Consider saving only the root hash of each tree and the tree directory here and then
// load the trees up in Rollback instead of setting them up here.
func (t *treeStore) save() (*Worldstate, error) {
if err := t.Commit(); err != nil {
return nil, err
Expand Down

0 comments on commit c9caaa3

Please sign in to comment.