Use null instead of comparing with empty lists

This commit is contained in:
Joseph C. Sible 2020-02-01 22:50:21 -05:00
parent e6e89d68fd
commit c29b6afa56
5 changed files with 14 additions and 14 deletions

View file

@ -643,7 +643,7 @@ getModifiedVariableCommand base@(T_SimpleCommand id cmdPrefix (T_NormalWord _ (T
getModifierParam _ _ = []
letParamToLiteral token =
if var == ""
if null var
then []
else [(base, token, var, DataString $ SourceFrom [stripEqualsFrom token])]
where var = takeWhile isVariableChar $ dropWhile (`elem` "+-") $ concat $ oversimplify token
@ -952,7 +952,7 @@ getOpts string flags = process flags
takesArg <- Map.lookup flag1 flagMap
if takesArg
then do
guard $ flag2 == ""
guard $ null flag2
more <- process rest
return $ (flag1, token2) : more
else do