git.iko.soy/typeable/attoparsec
on master help sign in
Replace uses of div with quot
commit23ed9b52671a7667a473a0cdaceb092400b7712d authorBryan O'Sullivan <bos@serpentine.com> dateWed 17 Apr 2013, 15:59 (13 years ago) parent9b41729
3 files changed+3−3
Data/Attoparsec/ByteString/FastSet.hs+1−1 Data/Attoparsec/Text/FastSet.hs+1−1 Data/Attoparsec/Text/Internal.hs+1−1
Data/Attoparsec/ByteString/FastSet.hs+1−1
@@ -83,7 +83,7 @@ memberWord8 w (Sorted s) = search 0 (B.length s - 1)
8383 where search lo hi
8484 | hi < lo = False
8585 | otherwise =
86− let mid = (lo + hi) `div` 2
86+ let mid = (lo + hi) `quot` 2
8787 in case compare w (U.unsafeIndex s mid) of
8888 GT -> search (mid + 1) hi
8989 LT -> search lo (mid - 1)
Data/Attoparsec/Text/FastSet.hs+1−1
@@ -50,7 +50,7 @@ member c (FastSet a) = uncurry search (A.bounds a)
5050 where search lo hi
5151 | hi < lo = False
5252 | otherwise =
53− let mid = (lo + hi) `div` 2
53+ let mid = (lo + hi) `quot` 2
5454 in case compare c (AB.unsafeAt a mid) of
5555 GT -> search (mid + 1) hi
5656 LT -> search lo (mid - 1)
Data/Attoparsec/Text/Internal.hs+1−1
@@ -90,7 +90,7 @@ instance (a ~ Text) => IsString (Parser a) where
9090 fromString = string . T.pack
9191
9292lengthAtLeast :: T.Text -> Int -> Bool
93−lengthAtLeast t@(T.Text _ _ len) n = (len `div` 2) >= n || T.length t >= n
93+lengthAtLeast t@(T.Text _ _ len) n = (len `quot` 2) >= n || T.length t >= n
9494{-# INLINE lengthAtLeast #-}
9595
9696-- | If at least @n@ characters of input are available, return the