Use the result of the comparison directly instead of an if/else
This commit is contained in:
parent
0ecaf2b5f1
commit
5adfea21ee
|
@ -5082,9 +5082,7 @@ checkExpansionWithRedirection params t =
|
||||||
T_FdRedirect id "1" (T_IoDuplicate _ _ _) -> return ()
|
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 "" (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) ] ->
|
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"
|
emit id captureId $ getLiteralString file /= Just "/dev/null"
|
||||||
then emit id captureId False
|
|
||||||
else emit id captureId True
|
|
||||||
_ -> acc
|
_ -> acc
|
||||||
|
|
||||||
emit redirectId captureId suggestTee = do
|
emit redirectId captureId suggestTee = do
|
||||||
|
|
Loading…
Reference in New Issue