mirror of
https://github.com/koalaman/shellcheck.git
synced 2025-08-26 12:50:38 +08:00
Use Map.member instead of isJust and Map.lookup
This commit is contained in:
@@ -849,7 +849,7 @@ checkArrayWithoutIndex params _ =
|
|||||||
readF _ _ _ = return []
|
readF _ _ _ = return []
|
||||||
|
|
||||||
writeF _ (T_Assignment id mode name [] _) _ (DataString _) = do
|
writeF _ (T_Assignment id mode name [] _) _ (DataString _) = do
|
||||||
isArray <- gets (isJust . Map.lookup name)
|
isArray <- gets (Map.member name)
|
||||||
return $ if not isArray then [] else
|
return $ if not isArray then [] else
|
||||||
case mode of
|
case mode of
|
||||||
Assign -> [makeComment WarningC id 2178 "Variable was used as an array but is now assigned a string."]
|
Assign -> [makeComment WarningC id 2178 "Variable was used as an array but is now assigned a string."]
|
||||||
|
Reference in New Issue
Block a user