[#1418] shard: Do not use pointers as parameters
Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
This commit is contained in:
parent
6d4d920bad
commit
5f57db6bf8
8 changed files with 10 additions and 10 deletions
|
@ -24,7 +24,7 @@ func (e *StorageEngine) exists(addr oid.Address) (bool, error) {
|
|||
e.reportShardError(sh, "could not check existence of object in shard", err)
|
||||
}
|
||||
|
||||
if res != nil && !exists {
|
||||
if !exists {
|
||||
exists = res.Exists()
|
||||
}
|
||||
|
||||
|
|
|
@ -20,7 +20,7 @@ func (p *ContainerSizePrm) WithContainerID(cnr cid.ID) {
|
|||
}
|
||||
}
|
||||
|
||||
func (r *ContainerSizeRes) Size() uint64 {
|
||||
func (r ContainerSizeRes) Size() uint64 {
|
||||
return r.size
|
||||
}
|
||||
|
||||
|
|
|
@ -42,7 +42,7 @@ type DumpRes struct {
|
|||
}
|
||||
|
||||
// Count return amount of object written.
|
||||
func (r *DumpRes) Count() int {
|
||||
func (r DumpRes) Count() int {
|
||||
return r.count
|
||||
}
|
||||
|
||||
|
|
|
@ -27,7 +27,7 @@ func (p *ExistsPrm) WithAddress(addr oid.Address) *ExistsPrm {
|
|||
}
|
||||
|
||||
// Exists returns the fact that the object is in the shard.
|
||||
func (p *ExistsRes) Exists() bool {
|
||||
func (p ExistsRes) Exists() bool {
|
||||
return p.ex
|
||||
}
|
||||
|
||||
|
|
|
@ -75,5 +75,5 @@ func (s *Shard) Inhume(prm InhumePrm) (*InhumeRes, error) {
|
|||
return nil, fmt.Errorf("metabase inhume: %w", err)
|
||||
}
|
||||
|
||||
return new(InhumeRes), nil
|
||||
return nil, nil
|
||||
}
|
||||
|
|
|
@ -49,12 +49,12 @@ func (p *RngPrm) WithIgnoreMeta(ignore bool) {
|
|||
// Object returns the requested object part.
|
||||
//
|
||||
// Instance payload contains the requested range of the original object.
|
||||
func (r *RngRes) Object() *object.Object {
|
||||
func (r RngRes) Object() *object.Object {
|
||||
return r.obj
|
||||
}
|
||||
|
||||
// HasMeta returns true if info about the object was found in the metabase.
|
||||
func (r *RngRes) HasMeta() bool {
|
||||
func (r RngRes) HasMeta() bool {
|
||||
return r.hasMeta
|
||||
}
|
||||
|
||||
|
|
|
@ -44,12 +44,12 @@ type RestoreRes struct {
|
|||
}
|
||||
|
||||
// Count return amount of object written.
|
||||
func (r *RestoreRes) Count() int {
|
||||
func (r RestoreRes) Count() int {
|
||||
return r.count
|
||||
}
|
||||
|
||||
// FailCount return amount of object skipped.
|
||||
func (r *RestoreRes) FailCount() int {
|
||||
func (r RestoreRes) FailCount() int {
|
||||
return r.failed
|
||||
}
|
||||
|
||||
|
|
|
@ -35,7 +35,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
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue