From 923eaeb8e115501a13fa572ed88daaeea910e78b Mon Sep 17 00:00:00 2001 From: vyzo Date: Sun, 27 Jun 2021 17:04:26 +0300 Subject: [PATCH] move code around for better readability --- blockstore/splitstore/splitstore.go | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/blockstore/splitstore/splitstore.go b/blockstore/splitstore/splitstore.go index 8b5fd8f53a4..b44c70d5240 100644 --- a/blockstore/splitstore/splitstore.go +++ b/blockstore/splitstore/splitstore.go @@ -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() @@ -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)