[#1239] innerring: Use pointer-less slices for object IDs

Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
This commit is contained in:
Evgenii Stratonikov 2022-03-28 16:15:15 +03:00 committed by Alex Vanin
parent 6ec104d686
commit 2ad8016d75
5 changed files with 12 additions and 13 deletions

View file

@ -48,11 +48,11 @@ func (x *SearchSGPrm) SetContainerID(id *cid.ID) {
// SearchSGRes groups resulting values of SearchSG operation.
type SearchSGRes struct {
cliRes []*oid.ID
cliRes []oid.ID
}
// IDList returns list of IDs of storage groups in container.
func (x SearchSGRes) IDList() []*oid.ID {
func (x SearchSGRes) IDList() []oid.ID {
return x.cliRes
}
@ -75,15 +75,14 @@ func (x Client) SearchSG(prm SearchSGPrm) (*SearchSGRes, error) {
rdr.UseKey(*x.key)
buf := make([]oid.ID, 10)
var list []*oid.ID
var list []oid.ID
var n int
var ok bool
for {
n, ok = rdr.Read(buf)
for i := 0; i < n; i++ {
v := buf[i]
list = append(list, &v)
list = append(list, buf[i])
}
if !ok {
break

View file

@ -107,8 +107,8 @@ func (ap *Processor) processStartAudit(epoch uint64) {
}
}
func (ap *Processor) findStorageGroups(cid *cid.ID, shuffled netmap.Nodes) []*oidSDK.ID {
var sg []*oidSDK.ID
func (ap *Processor) findStorageGroups(cid *cid.ID, shuffled netmap.Nodes) []oidSDK.ID {
var sg []oidSDK.ID
ln := len(shuffled)

View file

@ -89,11 +89,11 @@ func (x SearchSGPrm) NodeInfo() client.NodeInfo {
// SearchSGDst groups target values which Processor expects from SG searching to process.
type SearchSGDst struct {
ids []*oidSDK.ID
ids []oidSDK.ID
}
// WriteIDList writes list of identifiers of storage group objects stored in the container.
func (x *SearchSGDst) WriteIDList(ids []*oidSDK.ID) {
func (x *SearchSGDst) WriteIDList(ids []oidSDK.ID) {
x.ids = ids
}