[#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

@ -51,12 +51,16 @@ func (c *cache) Iterate(prm IterationPrm) error {
return err
}
return c.fsTree.Iterate(new(fstree.IterationPrm).WithHandler(func(addr oid.Address, data []byte) error {
var fsPrm fstree.IterationPrm
fsPrm.WithIgnoreErrors(prm.ignoreErrors)
fsPrm.WithHandler(func(addr oid.Address, data []byte) error {
if _, ok := c.flushed.Peek(addr.EncodeToString()); ok {
return nil
}
return prm.handler(data)
}).WithIgnoreErrors(prm.ignoreErrors))
})
return c.fsTree.Iterate(fsPrm)
}
// IterateDB iterates over all objects stored in bbolt.DB instance and passes them to f until error return.