Remove redundant subtraction in (^) and stimes (trac#14439)
ClosedPublic

Authored by Bodigrim on Nov 9 2017, 5:28 PM.

Details

Summary

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

Diff Detail

Repository
rGHC Glasgow Haskell Compiler
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
Bodigrim created this revision.Nov 9 2017, 5:28 PM
Bodigrim edited the summary of this revision. (Show Details)Nov 9 2017, 5:32 PM
Bodigrim updated this revision to Diff 14625.Nov 11 2017, 6:46 AM

Remove double space.

Yes, this looks right. However, can we have a comment explaining why this is true? As-written a reader would have quite some difficulty reconstructing the reasoning here.

bgamari requested changes to this revision.Nov 11 2017, 9:51 AM
This revision now requires changes to proceed.Nov 11 2017, 9:51 AM
Bodigrim updated this revision to Diff 14629.Nov 11 2017, 3:03 PM

Add comments.

bgamari accepted this revision.Nov 11 2017, 5:05 PM

Thanks!

This revision is now accepted and ready to land.Nov 11 2017, 5:05 PM
bgamari edited the summary of this revision. (Show Details)Nov 21 2017, 8:14 PM
This revision was automatically updated to reflect the committed changes.