This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "snap-core".
The branch, enumerator has been updated
via c48295fbf49827e0b65b66d7c7048651b0193edc (commit)
from b744db683f29ea43bcebf66ada9966af9ca25dfd (commit)
Summary of changes:
src/Snap/Iteratee.hs | 10 ++++------
1 files changed, 4 insertions(+), 6 deletions(-)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit c48295fbf49827e0b65b66d7c7048651b0193edc
Author: Gregory Collins <[email protected]>
Date: Sun Nov 21 14:56:02 2010 +0100
Make enumLBS enumerate one chunk at a time
diff --git a/src/Snap/Iteratee.hs b/src/Snap/Iteratee.hs
index 1a7b59a..36f5e3d 100644
--- a/src/Snap/Iteratee.hs
+++ b/src/Snap/Iteratee.hs
@@ -166,11 +166,9 @@ enumBS _ (Error e) = Iteratee $ return $ Error e
------------------------------------------------------------------------------
-- | Enumerates a lazy bytestring.
+
enumLBS :: (Monad m) => L.ByteString -> Enumerator ByteString m a
-enumLBS bs (Continue k) = k (Chunks $ L.toChunks bs)
-enumLBS bs (Yield x s) = Iteratee $ return $
- Yield x (s `mappend` Chunks (L.toChunks bs))
-enumLBS _ (Error e) = Iteratee $ return $ Error e
+enumLBS bs = enumList 1 (L.toChunks bs)
{-# INLINE enumLBS #-}
@@ -288,7 +286,7 @@ unsafeBufferIterateeWithBuffer buf iter = Iteratee $ do
step <- sendBuf n k
step2 <- runIteratee $ enumEOF step
return $ copyStep step2
-
+
go !n !k ch@(Chunks xs) = Iteratee $ do
assert (n >= 0) (return ())
@@ -336,7 +334,7 @@ unsafeBufferIterateeWithBuffer buf iter = Iteratee $ do
{-# SCC "unsafeBufferIteratee/overflow" #-} do
assert (n+m >= bUFSIZ) (return ())
assert (n < bUFSIZ) (return ())
-
+
let rest = bUFSIZ - n
let m2 = m - rest
-----------------------------------------------------------------------
hooks/post-receive
--
snap-core
_______________________________________________
Snap mailing list
[email protected]
http://mailman-mail5.webfaction.com/listinfo/snap