Skip to content

Commit

Permalink
Swap the order of the tuple returned by orderEdge
Browse files Browse the repository at this point in the history
  • Loading branch information
josephcsible committed Jul 7, 2024
1 parent 8746c6e commit e5fdec9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/ShellCheck/CFG.hs
Original file line number Diff line number Diff line change
Expand Up @@ -300,13 +300,13 @@ removeUnnecessaryStructuralNodes (nodes, edges, mapping, association) =
edgesToCollapse = S.fromList $ filter filterEdges regularEdges

remapping :: M.Map Node Node
remapping = foldl' (\m (new, old) -> M.insert old new m) M.empty $ map orderEdge $ S.toList edgesToCollapse
remapping = foldl' (\m (old, new) -> M.insert old new m) M.empty $ map orderEdge $ S.toList edgesToCollapse
recursiveRemapping = M.fromList $ map (\c -> (c, recursiveLookup remapping c)) $ M.keys remapping

filterEdges (a,b,_) =
a `S.member` candidateNodes && b `S.member` candidateNodes

orderEdge (a,b,_) = if a < b then (a,b) else (b,a)
orderEdge (a,b,_) = if a < b then (b,a) else (a,b)
counter = foldl' (\map key -> M.insertWith (+) key 1 map) M.empty
isRegularEdge (_, _, CFEFlow) = True
isRegularEdge _ = False
Expand Down

0 comments on commit e5fdec9

Please sign in to comment.