[commit: packages/base] master: Expand comment for enumDeltaToInteger1 (d13662d)

git at git.haskell.org git at git.haskell.org
Mon Feb 17 09:28:53 UTC 2014


Repository : ssh://git@git.haskell.org/base

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/d13662db345129ac7a13543fafdf678c0cc896e4/base

>---------------------------------------------------------------

commit d13662db345129ac7a13543fafdf678c0cc896e4
Author: Joachim Breitner <mail at joachim-breitner.de>
Date:   Mon Feb 17 09:30:07 2014 +0000

    Expand comment for enumDeltaToInteger1


>---------------------------------------------------------------

d13662db345129ac7a13543fafdf678c0cc896e4
 GHC/Enum.lhs |    2 ++
 1 file changed, 2 insertions(+)

diff --git a/GHC/Enum.lhs b/GHC/Enum.lhs
index 2934c72..c8208fa 100644
--- a/GHC/Enum.lhs
+++ b/GHC/Enum.lhs
@@ -707,6 +707,8 @@ enumDeltaToIntegerFB c n x delta lim
 -- This rule ensures that in the common case (delta = 1), we do not do the check here,
 -- and also that we have the chance to inline up_fb, which would allow the constuctor to be
 -- inlined and good things to happen.
+-- We do not do it for Int this way because hand-tuned code already exists, and
+-- the sepcial case varies more from the general case, due to the issue of overflows.
 
 {-# NOINLINE [1] enumDeltaToInteger #-}
 enumDeltaToInteger :: Integer -> Integer -> Integer -> [Integer]



More information about the ghc-commits mailing list