Commits

Bryan O'Sullivan committed ee2a6d3

Replace uses of div with quot

  • Participants
  • Parent commits f61497e

Comments (0)

Files changed (3)

Data/Attoparsec/ByteString/FastSet.hs

     where search lo hi
               | hi < lo = False
               | otherwise =
-                  let mid = (lo + hi) `div` 2
+                  let mid = (lo + hi) `quot` 2
                   in case compare w (U.unsafeIndex s mid) of
                        GT -> search (mid + 1) hi
                        LT -> search lo (mid - 1)

Data/Attoparsec/Text/FastSet.hs

     where search lo hi
               | hi < lo = False
               | otherwise =
-                  let mid = (lo + hi) `div` 2
+                  let mid = (lo + hi) `quot` 2
                   in case compare c (AB.unsafeAt a mid) of
                        GT -> search (mid + 1) hi
                        LT -> search lo (mid - 1)

Data/Attoparsec/Text/Internal.hs

     fromString = string . T.pack
 
 lengthAtLeast :: T.Text -> Int -> Bool
-lengthAtLeast t@(T.Text _ _ len) n = (len `div` 2) >= n || T.length t >= n
+lengthAtLeast t@(T.Text _ _ len) n = (len `quot` 2) >= n || T.length t >= n
 {-# INLINE lengthAtLeast #-}
 
 -- | If at least @n@ characters of input are available, return the