From 6d4d920bad0e9ccd4c3ffa172299338083f20b1c Mon Sep 17 00:00:00 2001 From: Pavel Karpy Date: Fri, 20 May 2022 19:48:14 +0300 Subject: [PATCH] [#1418] meta: Do not use pointers as parameters Signed-off-by: Pavel Karpy --- pkg/local_object_storage/metabase/delete.go | 2 +- pkg/local_object_storage/metabase/select.go | 2 +- pkg/local_object_storage/metabase/small.go | 2 +- pkg/local_object_storage/shard/list.go | 1 - 4 files changed, 3 insertions(+), 4 deletions(-) diff --git a/pkg/local_object_storage/metabase/delete.go b/pkg/local_object_storage/metabase/delete.go index 134aaddde..cc54e58f5 100644 --- a/pkg/local_object_storage/metabase/delete.go +++ b/pkg/local_object_storage/metabase/delete.go @@ -61,7 +61,7 @@ func (db *DB) Delete(prm DeletePrm) (*DeleteRes, error) { storagelog.OpField("metabase DELETE")) } } - return new(DeleteRes), err + return nil, err } func (db *DB) deleteGroup(tx *bbolt.Tx, addrs []oid.Address) error { diff --git a/pkg/local_object_storage/metabase/select.go b/pkg/local_object_storage/metabase/select.go index a18ca662e..2eaf9dfee 100644 --- a/pkg/local_object_storage/metabase/select.go +++ b/pkg/local_object_storage/metabase/select.go @@ -54,7 +54,7 @@ func (p *SelectPrm) WithFilters(fs object.SearchFilters) { } // AddressList returns list of addresses of the selected objects. -func (r *SelectRes) AddressList() []oid.Address { +func (r SelectRes) AddressList() []oid.Address { return r.addrList } diff --git a/pkg/local_object_storage/metabase/small.go b/pkg/local_object_storage/metabase/small.go index 2b5a3e1a0..d39594618 100644 --- a/pkg/local_object_storage/metabase/small.go +++ b/pkg/local_object_storage/metabase/small.go @@ -25,7 +25,7 @@ func (p *IsSmallPrm) WithAddress(addr oid.Address) { } // BlobovniczaID returns blobovnicza identifier. -func (r *IsSmallRes) BlobovniczaID() *blobovnicza.ID { +func (r IsSmallRes) BlobovniczaID() *blobovnicza.ID { return r.id } diff --git a/pkg/local_object_storage/shard/list.go b/pkg/local_object_storage/shard/list.go index 403e751af..f3166e300 100644 --- a/pkg/local_object_storage/shard/list.go +++ b/pkg/local_object_storage/shard/list.go @@ -119,7 +119,6 @@ func (s *Shard) ListWithCursor(prm ListWithCursorPrm) (*ListWithCursorRes, error var metaPrm meta.ListPrm metaPrm.WithCount(prm.count) metaPrm.WithCursor(prm.cursor) - res, err := s.metaBase.ListWithCursor(metaPrm) if err != nil { return nil, fmt.Errorf("could not get list of objects: %w", err)