on master help sign in
Switched to unsafe (ie, no-copy) pack functions for zlib
commit7766ef61ec3be8757e147646fa6218b3d24925cc authorMichael Snoyman <michael@snoyman.com> dateFri 14 May 2010, 08:33 (16 years ago) parent4de9551
1 file changed+2−2
Network/Wai/Zlib.hs+2−2
Network/Wai/Zlib.hs+2−2
@@ -48,7 +48,7 @@ finishStream iter stream outbuff acc = do
4848 c_set_avail_out stream outbuff $ fromIntegral chunkSize
4949 status <- c_call_deflate_finish stream
5050 newAvail <- fromIntegral `fmap` c_get_avail_out stream
51− bs <- packCStringLen (outbuff, chunkSize - newAvail)
51+ bs <- unsafePackCStringLen (outbuff, chunkSize - newAvail)
5252 eacc <- iter acc bs
5353 if status == 0 || newAvail == 0
5454 then case eacc of
@@ -71,7 +71,7 @@ compressIter iter stream outbuff accInit bsInput = do
7171 c_set_avail_out stream outbuff $ fromIntegral chunkSize
7272 c_call_deflate_noflush stream
7373 newAvail <- fromIntegral `fmap` c_get_avail_out stream
74− bs <- packCStringLen (outbuff, chunkSize - newAvail)
74+ bs <- unsafePackCStringLen (outbuff, chunkSize - newAvail)
7575 eacc <- iter acc bs
7676 if newAvail == 0
7777 then case eacc of