on master help sign in
Twiddles
f69f2acBryan O'Sullivan
Data/Text/UnsafeChar.hs+2−2
@@ -48,12 +48,12 @@ unsafeWrite marr i c
48 | n < 0x10000 = do
48 | n < 0x10000 = do
49 assert (i >= 0) . assert (i < A.length marr) $
49 assert (i >= 0) . assert (i < A.length marr) $
50 A.unsafeWrite marr i (fromIntegral n)
50 A.unsafeWrite marr i (fromIntegral n)
51− return (i+1)
51+ return $! i+1
52 | otherwise = do
52 | otherwise = do
53 assert (i >= 0) . assert (i < A.length marr - 1) $
53 assert (i >= 0) . assert (i < A.length marr - 1) $
54 A.unsafeWrite marr i lo
54 A.unsafeWrite marr i lo
55 A.unsafeWrite marr (i+1) hi
55 A.unsafeWrite marr (i+1) hi
56− return (i+2)
56+ return $! i+2
57 where n = ord c
57 where n = ord c
58 m = n - 0x10000
58 m = n - 0x10000
59 lo = fromIntegral $ (m `shiftR` 10) + 0xD800
59 lo = fromIntegral $ (m `shiftR` 10) + 0xD800