Skip to content

Commit

Permalink
Use traverse instead of sequence and map
Browse files Browse the repository at this point in the history
  • Loading branch information
josephcsible committed Dec 30, 2023
1 parent 3bd7df9 commit dedf932
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/ShellCheck/Analytics.hs
Original file line number Diff line number Diff line change
Expand Up @@ -4936,7 +4936,7 @@ checkOverwrittenExitCode params t =
guard . not $ S.null exitCodeIds

let idToToken = idMap params
exitCodeTokens <- sequence $ map (\k -> Map.lookup k idToToken) $ S.toList exitCodeIds
exitCodeTokens <- traverse (\k -> Map.lookup k idToToken) $ S.toList exitCodeIds
return $ do
when (all isCondition exitCodeTokens && not (usedUnconditionally t exitCodeIds)) $
warn id 2319 "This $? refers to a condition, not a command. Assign to a variable to avoid it being overwritten."
Expand Down

0 comments on commit dedf932

Please sign in to comment.