Skip to content

Commit

Permalink
move code around for better readability
Browse files Browse the repository at this point in the history
  • Loading branch information
vyzo committed Jun 27, 2021
1 parent 1709119 commit 923eaeb
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions blockstore/splitstore/splitstore.go
Original file line number Diff line number Diff line change
Expand Up @@ -263,19 +263,6 @@ func (s *SplitStore) Get(cid cid.Cid) (blocks.Block, error) {
}
}

// internal version used by walk so that we don't blow the txn
func (s *SplitStore) get(cid cid.Cid) (blocks.Block, error) {
blk, err := s.hot.Get(cid)

switch err {
case bstore.ErrNotFound:
return s.cold.Get(cid)

default:
return blk, err
}
}

func (s *SplitStore) GetSize(cid cid.Cid) (int, error) {
s.txnLk.RLock()
defer s.txnLk.RUnlock()
Expand Down Expand Up @@ -1087,6 +1074,19 @@ func (s *SplitStore) walkLinks(c cid.Cid, walked *cid.Set, f func(cid.Cid) error
return rerr
}

// internal version used by walk so that we don't blow the txn
func (s *SplitStore) get(cid cid.Cid) (blocks.Block, error) {
blk, err := s.hot.Get(cid)

switch err {
case bstore.ErrNotFound:
return s.cold.Get(cid)

default:
return blk, err
}
}

func (s *SplitStore) moveColdBlocks(cold []cid.Cid) error {
batch := make([]blocks.Block, 0, batchSize)

Expand Down

0 comments on commit 923eaeb

Please sign in to comment.