base: Remove redundant subtraction in (^) and stimes
authorBen Gamari <ben@smart-cactus.org>
Wed, 22 Nov 2017 02:15:29 +0000 (21:15 -0500)
committerBen Gamari <ben@smart-cactus.org>
Wed, 22 Nov 2017 02:15:30 +0000 (21:15 -0500)
commiteb5a40cea6c64f5300c7697231cb0ede2c554388
tree921e82eb39f26f8684e39213af8eb4a802f73fcd
parent23116dfee485902cb3c26640e38f62032bebe72d
base: Remove redundant subtraction in (^) and stimes

Subtraction `y - 1` is redundant. The value of y is guaranteed to be
positive and odd, so
```
(y - 1) `quot` 2` = `y `quot` 2
```

Test Plan: validate

Reviewers: hvr, bgamari

Reviewed By: bgamari

Subscribers: rwbarton, thomie

GHC Trac Issues: #14439

Differential Revision: https://phabricator.haskell.org/D4173
libraries/base/Data/Semigroup/Internal.hs
libraries/base/GHC/Real.hs