forked from TrueCloudLab/frostfs-node
[#1671] Use slices.ContainsFunc()
where possible
Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
This commit is contained in:
parent
460e5cbccf
commit
ecb6b0793c
5 changed files with 16 additions and 28 deletions
|
@ -345,14 +345,11 @@ func (s *Service) GetNodeByPath(ctx context.Context, req *GetNodeByPathRequest)
|
|||
} else {
|
||||
var metaValue []KeyValue
|
||||
for _, kv := range m.Items {
|
||||
for _, attr := range b.GetAttributes() {
|
||||
if kv.Key == attr {
|
||||
metaValue = append(metaValue, KeyValue{
|
||||
Key: kv.Key,
|
||||
Value: kv.Value,
|
||||
})
|
||||
break
|
||||
}
|
||||
if slices.Contains(b.GetAttributes(), kv.Key) {
|
||||
metaValue = append(metaValue, KeyValue{
|
||||
Key: kv.Key,
|
||||
Value: kv.Value,
|
||||
})
|
||||
}
|
||||
}
|
||||
x.Meta = metaValue
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue