Skip to content

Commit dbcc8da

Browse files
committed
use slices.Contains
Signed-off-by: Angelo De Caro <adc@zurich.ibm.com>
1 parent 02a8def commit dbcc8da

1 file changed

Lines changed: 2 additions & 8 deletions

File tree

token/services/network/fabric/lookup/channelflm.go

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ package lookup
99
import (
1010
"context"
1111
"encoding/base64"
12+
"slices"
1213
"sync"
1314
"time"
1415

@@ -135,14 +136,7 @@ func (s *Scanner) Scan() {
135136
return false, err
136137
}
137138

138-
found := false
139-
for _, ns := range rws.Namespaces() {
140-
if ns == s.namespace {
141-
found = true
142-
break
143-
}
144-
}
145-
if !found {
139+
if !slices.Contains(rws.Namespaces(), s.namespace) {
146140
logger.Debugf("scanning [%s] does not contain namespace [%s]", tx.TxID(), s.namespace)
147141
return false, nil
148142
}

0 commit comments

Comments
 (0)