[#1418] blobstor: Do not use pointers as parameters

Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
This commit is contained in:
Pavel Karpy 2022-05-23 17:15:16 +03:00 committed by fyrchik
parent babd382ba5
commit 281befec67
26 changed files with 89 additions and 66 deletions

View file

@ -88,7 +88,9 @@ func (b *BlobStor) Iterate(prm IteratePrm) (*IterateRes, error) {
elem.blzID = nil
err = b.fsTree.Iterate(new(fstree.IterationPrm).WithHandler(func(_ oid.Address, data []byte) error {
var fsPrm fstree.IterationPrm
fsPrm.WithIgnoreErrors(prm.ignoreErrors)
fsPrm.WithHandler(func(_ oid.Address, data []byte) error {
// decompress the data
elem.data, err = b.decompressor(data)
if err != nil {
@ -99,7 +101,9 @@ func (b *BlobStor) Iterate(prm IteratePrm) (*IterateRes, error) {
}
return prm.handler(elem)
}).WithIgnoreErrors(prm.ignoreErrors))
})
err = b.fsTree.Iterate(fsPrm)
if err != nil {
return nil, fmt.Errorf("fs tree iterator failure: %w", err)