mirror of
https://github.com/koalaman/shellcheck
synced 2025-07-06 04:51:37 -07:00
Use find instead of listToMaybe and filter
This commit is contained in:
parent
dc2f388310
commit
8b3c37aa36
1 changed files with 1 additions and 1 deletions
|
@ -3320,7 +3320,7 @@ checkReturnAgainstZero params token =
|
||||||
|
|
||||||
isFirstCommandInFunction = fromMaybe False $ do
|
isFirstCommandInFunction = fromMaybe False $ do
|
||||||
let path = getPath (parentMap params) token
|
let path = getPath (parentMap params) token
|
||||||
func <- listToMaybe $ filter isFunction path
|
func <- find isFunction path
|
||||||
cmd <- getClosestCommand (parentMap params) token
|
cmd <- getClosestCommand (parentMap params) token
|
||||||
return $ getId cmd == getId (getFirstCommandInFunction func)
|
return $ getId cmd == getId (getFirstCommandInFunction func)
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue