diff options
author | Simon Jakobi <simon.jakobi@gmail.com> | 2022-05-07 17:33:50 +0200 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2022-05-08 12:23:43 -0400 |
commit | 67072c31d8b6ce4f0de79fa52bc3e5cdd5a495c6 (patch) | |
tree | 64524150c2802fcd9ffec5e73a8f211b1f0f23e9 | |
parent | 3c91de2109701d1d6d42da3838c4847f51135d4e (diff) | |
download | haskell-67072c31d8b6ce4f0de79fa52bc3e5cdd5a495c6.tar.gz |
Tweak GHC.CmmToAsm.CFG.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) |