From 8b3c37aa36bcb74b09d71eba4ce0ce0141b8bd4f Mon Sep 17 00:00:00 2001 From: "Joseph C. Sible" Date: Mon, 16 Oct 2023 00:06:53 -0400 Subject: [PATCH] Use find instead of listToMaybe and filter --- src/ShellCheck/Analytics.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ShellCheck/Analytics.hs b/src/ShellCheck/Analytics.hs index 7e8b51047..3cebb2481 100644 --- a/src/ShellCheck/Analytics.hs +++ b/src/ShellCheck/Analytics.hs @@ -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)