Skip to content

Commit

Permalink
Use find instead of listToMaybe and filter
Browse files Browse the repository at this point in the history
  • Loading branch information
josephcsible committed Oct 16, 2023
1 parent dc2f388 commit 8b3c37a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/ShellCheck/Analytics.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down

0 comments on commit 8b3c37a

Please sign in to comment.