Skip to content

Commit

Permalink
Simplify getAssociativeArrays
Browse files Browse the repository at this point in the history
  • Loading branch information
josephcsible committed Apr 5, 2020
1 parent 8f10507 commit b6cff5e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/ShellCheck/ASTLib.hs
Original file line number Diff line number Diff line change
Expand Up @@ -398,10 +398,10 @@ getAssociativeArrays t =
f t@T_SimpleCommand {} = sequence_ $ do
name <- getCommandName t
let assocNames = ["declare","local","typeset"]
guard $ elem name assocNames
guard $ name `elem` assocNames
let flags = getAllFlags t
guard $ elem "A" $ map snd flags
let args = map fst . filter ((==) "" . snd) $ flags
guard $ "A" `elem` map snd flags
let args = [arg | (arg, "") <- flags]
let names = mapMaybe (getLiteralStringExt nameAssignments) args
return $ tell names
f _ = return ()
Expand Down

0 comments on commit b6cff5e

Please sign in to comment.