Skip to content

Commit 6b39e92

Browse files
authored
beacon/engine: using slices.Contains (#29396)
1 parent 1f8f137 commit 6b39e92

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

beacon/engine/types.go

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ package engine
1919
import (
2020
"fmt"
2121
"math/big"
22+
"slices"
2223

2324
"github.com/ethereum/go-ethereum/common"
2425
"github.com/ethereum/go-ethereum/common/hexutil"
@@ -132,12 +133,7 @@ func (b PayloadID) Version() PayloadVersion {
132133

133134
// Is returns whether the identifier matches any of provided payload versions.
134135
func (b PayloadID) Is(versions ...PayloadVersion) bool {
135-
for _, v := range versions {
136-
if v == b.Version() {
137-
return true
138-
}
139-
}
140-
return false
136+
return slices.Contains(versions, b.Version())
141137
}
142138

143139
func (b PayloadID) String() string {

0 commit comments

Comments
 (0)