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