mirror of
https://github.com/koalaman/shellcheck
synced 2025-07-05 20:41:35 -07:00
Use the result of the comparison directly instead of an if/else
This commit is contained in:
parent
0ecaf2b5f1
commit
5adfea21ee
1 changed files with 1 additions and 3 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue