forked from TrueCloudLab/frostfs-node
[#1239] neofs-cli: Use pointer-less slices for object ID
Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
This commit is contained in:
parent
882236a03b
commit
dd9bd05bac
3 changed files with 8 additions and 9 deletions
|
@ -631,11 +631,11 @@ func (x *SearchObjectsPrm) SetFilters(filters object.SearchFilters) {
|
|||
|
||||
// SearchObjectsRes groups resulting values of SearchObjects operation.
|
||||
type SearchObjectsRes struct {
|
||||
ids []*oidSDK.ID
|
||||
ids []oidSDK.ID
|
||||
}
|
||||
|
||||
// IDList returns identifiers of the matched objects.
|
||||
func (x SearchObjectsRes) IDList() []*oidSDK.ID {
|
||||
func (x SearchObjectsRes) IDList() []oidSDK.ID {
|
||||
return x.ids
|
||||
}
|
||||
|
||||
|
@ -671,15 +671,14 @@ func SearchObjects(prm SearchObjectsPrm) (*SearchObjectsRes, error) {
|
|||
}
|
||||
|
||||
buf := make([]oidSDK.ID, 10)
|
||||
var list []*oidSDK.ID
|
||||
var list []oidSDK.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
|
||||
|
|
|
@ -624,8 +624,8 @@ func searchObject(cmd *cobra.Command, _ []string) {
|
|||
ids := res.IDList()
|
||||
|
||||
cmd.Printf("Found %d objects.\n", len(ids))
|
||||
for _, id := range ids {
|
||||
cmd.Println(id)
|
||||
for i := range ids {
|
||||
cmd.Println(ids[i].String())
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -286,8 +286,8 @@ func listSG(cmd *cobra.Command, _ []string) {
|
|||
|
||||
cmd.Printf("Found %d storage groups.\n", len(ids))
|
||||
|
||||
for _, id := range ids {
|
||||
cmd.Println(id)
|
||||
for i := range ids {
|
||||
cmd.Println(ids[i].String())
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue