on master help sign in
Fix a longstanding latent bug
commitfe489632e2154541b26545f5b4ebd04c2c546bfe authorBryan O'Sullivan <bos@serpentine.com> dateMon 3 Nov 2014, 14:32 (12 years ago) parent2b13ada
1 file changed+4−4
Data/Text/Lazy/Builder/Int.hs+4−4
Data/Text/Lazy/Builder/Int.hs+4−4
@@ -186,10 +186,6 @@ hexDigit n
186186 | otherwise = singleton $! toEnum (fromIntegral n + 87)
187187{-# INLINE hexDigit #-}
188188
189−int :: Int -> Builder
190−int = decimal
191−{-# INLINE int #-}
192−
193189data T = T !Integer !Int
194190
195191integer :: Int -> Integer -> Builder
@@ -248,6 +244,10 @@ integer base i
248244 r = fromInteger y
249245 putB _ = mempty
250246
247+ int :: Int -> Builder
248+ int x | base == 10 = decimal x
249+ | otherwise = hexadecimal x
250+
251251 pblock = loop maxDigits
252252 where
253253 loop !d !n