Commits

Bryan O'Sullivan committed 781101b

Inline more aggressively.

With cheaper per-iteration tests, this gains 15% on performance.

Comments (0)

Files changed (1)

Data/Attoparsec/Internal.hs

   if B.null t
     then (skipWhile p <|> return ())
     else return ()
+{-# INLINE skipWhile #-}
 
 takeTill :: (Word8 -> Bool) -> Parser B.ByteString
 takeTill p = takeWhile (not . p)
     if B.null t
       then (h+++) `fmapP` (go <|> return B.empty)
       else return h
+{-# INLINE takeWhile #-}
 
 takeWhile1 :: (Word8 -> Bool) -> Parser B.ByteString
 takeWhile1 p = do
   if B.null t
     then (h+++) `fmapP` (takeWhile p <|> return B.empty)
     else return h
+{-# INLINE takeWhile1 #-}
 
 -- | Match any character in a set.
 --