[#1671] Use slices.ContainsFunc() where possible

Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
This commit is contained in:
Evgenii Stratonikov 2025-03-13 09:34:59 +03:00 committed by Evgenii Stratonikov
parent 460e5cbccf
commit ecb6b0793c
5 changed files with 16 additions and 28 deletions

View file

@ -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