Commits

Bryan O'Sullivan committed ee2a6d3

Replace uses of div with quot

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
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.