Commits

Bryan O'Sullivan committed aa61f1d

Slightly speed up skipWhile

  • Participants
  • Parent commits fa4ee94

Comments (0)

Files changed (1)

File Data/Attoparsec/Internal.hs

 skipWhile p = go
  where
   go = do
-    input <- wantInput
-    when input $ do
-      t <- B8.dropWhile p <$> get
-      put t
-      when (B.null t) go
+    t <- B8.dropWhile p <$> get
+    put t
+    when (B.null t) $ do
+      input <- wantInput
+      when input go
 {-# INLINE skipWhile #-}
 
 -- | Consume input as long as the predicate returns 'False'