mirror of
https://github.com/koalaman/shellcheck.git
synced 2025-08-08 11:14:25 +08:00
Use find instead of listToMaybe and filter
This commit is contained in:
@@ -3320,7 +3320,7 @@ checkReturnAgainstZero params token =
|
||||
|
||||
isFirstCommandInFunction = fromMaybe False $ do
|
||||
let path = getPath (parentMap params) token
|
||||
func <- listToMaybe $ filter isFunction path
|
||||
func <- find isFunction path
|
||||
cmd <- getClosestCommand (parentMap params) token
|
||||
return $ getId cmd == getId (getFirstCommandInFunction func)
|
||||
|
||||
|
Reference in New Issue
Block a user