From 5adfea21eec84a6bc8bbcaf4e22c02461dd850d9 Mon Sep 17 00:00:00 2001 From: "Joseph C. Sible" Date: Fri, 13 Dec 2024 23:20:48 -0500 Subject: [PATCH] Use the result of the comparison directly instead of an if/else --- src/ShellCheck/Analytics.hs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/ShellCheck/Analytics.hs b/src/ShellCheck/Analytics.hs index 3a47ed9..4757e57 100644 --- a/src/ShellCheck/Analytics.hs +++ b/src/ShellCheck/Analytics.hs @@ -5082,9 +5082,7 @@ checkExpansionWithRedirection params t = T_FdRedirect id "1" (T_IoDuplicate _ _ _) -> return () T_FdRedirect id "" (T_IoDuplicate _ op _) | op `elem` [T_GREATAND (Id 0), T_Greater (Id 0)] -> emit id captureId True T_FdRedirect id str (T_IoFile _ op file) | str `elem` ["", "1"] && op `elem` [ T_DGREAT (Id 0), T_Greater (Id 0) ] -> - if getLiteralString file == Just "/dev/null" - then emit id captureId False - else emit id captureId True + emit id captureId $ getLiteralString file /= Just "/dev/null" _ -> acc emit redirectId captureId suggestTee = do