mirror of
https://github.com/OffchainLabs/prysm.git
synced 2026-01-08 23:18:15 -05:00
refactor: using slices.Contains to simplify the code (#14781)
Signed-off-by: oftenoccur <ezc5@sina.com> Co-authored-by: Raul Jordan <raul@prysmaticlabs.com>
This commit is contained in:
@@ -6,6 +6,7 @@ import (
|
||||
"errors"
|
||||
"go/ast"
|
||||
"go/token"
|
||||
"slices"
|
||||
|
||||
"golang.org/x/tools/go/analysis"
|
||||
"golang.org/x/tools/go/analysis/passes/inspect"
|
||||
@@ -100,10 +101,5 @@ func inspectFunctionParams(pass *analysis.Pass, paramList []*ast.Field) {
|
||||
}
|
||||
|
||||
func shadows(name string) bool {
|
||||
for _, identifier := range predeclared {
|
||||
if identifier == name {
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
return slices.Contains(predeclared, name)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user