diff options
author | Simon Jakobi <simon.jakobi@gmail.com> | 2022-05-07 17:33:50 +0200 |
---|---|---|
committer | Simon Jakobi <simon.jakobi@gmail.com> | 2022-05-07 17:33:50 +0200 |
commit | d65dd96cc7ca08d1b904f633a9806d444770b6c0 (patch) | |
tree | f458e8f61155dc5cde5e4a3b443ee93425ecd7a0 | |
parent | ced4689e2a049b6653f5ada3254dde684cb0c433 (diff) | |
download | haskell-wip/sjakobi/delEdge.tar.gz |
Tweak GHC.CmmToAsm.CFG.delEdgewip/sjakobi/delEdge
mapAdjust is more efficient than mapAlter.
-rw-r--r-- | compiler/GHC/CmmToAsm/CFG.hs | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/compiler/GHC/CmmToAsm/CFG.hs b/compiler/GHC/CmmToAsm/CFG.hs index 99df21c46b..e992116117 100644 --- a/compiler/GHC/CmmToAsm/CFG.hs +++ b/compiler/GHC/CmmToAsm/CFG.hs @@ -387,10 +387,7 @@ addWeightEdge from to weight cfg = delEdge :: BlockId -> BlockId -> CFG -> CFG delEdge from to m = - mapAlter remDest from m - where - remDest Nothing = Nothing - remDest (Just wm) = Just $ mapDelete to wm + mapAdjust (mapDelete to) from m -- | Destinations from bid ordered by weight (descending) |