mirror of
https://github.com/OffchainLabs/prysm.git
synced 2026-01-08 07:03:58 -05:00
using slices.Index (#13836)
This commit is contained in:
@@ -91,6 +91,7 @@ package mvslice
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"slices"
|
||||
"sync"
|
||||
|
||||
"github.com/pkg/errors"
|
||||
@@ -578,10 +579,8 @@ func (s *Slice[V]) updateAppendedItem(obj Identifiable, index uint64, val V) err
|
||||
}
|
||||
|
||||
func containsId(ids []uint64, wanted uint64) (int, bool) {
|
||||
for i, id := range ids {
|
||||
if id == wanted {
|
||||
return i, true
|
||||
}
|
||||
if i := slices.Index(ids, wanted); i >= 0 {
|
||||
return i, true
|
||||
}
|
||||
return 0, false
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user