Use dropWhileEndLE p instead of reverse . dropWhile p . reverse
Summary: Using `dropWhileEndLE` tends to be faster and easier to read than the `reverse . dropWhile p . reverse` idiom. This also cleans up some other, nearby, messes. Fix #9616 (incorrect number formatting potentially leading to incorrect numbers in output). Test Plan: Run validate Reviewers: thomie, rwbarton, nomeata, austin Reviewed By: nomeata, austin Subscribers: simonmar, ezyang, carter, thomie Projects: #ghc Differential Revision: https://phabricator.haskell.org/D259 GHC Trac Issues: #9623, #9616 Conflicts: compiler/basicTypes/OccName.lhs
Showing
- compiler/basicTypes/OccName.lhs 1 addition, 1 deletioncompiler/basicTypes/OccName.lhs
- compiler/utils/Util.lhs 15 additions, 1 deletioncompiler/utils/Util.lhs
- libraries/base/GHC/Windows.hs 2 additions, 1 deletionlibraries/base/GHC/Windows.hs
- utils/hpc/HpcMarkup.hs 19 additions, 6 deletionsutils/hpc/HpcMarkup.hs
- utils/hpc/HpcUtils.hs 4 additions, 0 deletionsutils/hpc/HpcUtils.hs
Loading
Please register or sign in to comment