We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 2ef63df commit b43d295Copy full SHA for b43d295
Data/ByteString/Internal.hs
@@ -339,17 +339,17 @@ packChars cs = unsafePackLenChars (List.length cs) cs
339
#-}
340
341
unsafePackLenBytes :: Int -> [Word8] -> ByteString
342
-unsafePackLenBytes len xs =
343
- unsafeCreate len $ \p0 -> foldr
+unsafePackLenBytes len =
+ unsafeCreate len . foldr
344
(\x go p -> poke p x >> go (p `plusPtr` 1))
345
- (\_ -> return ()) xs p0
+ (\_ -> return ())
346
{-# INLINE unsafePackLenBytes #-}
347
348
unsafePackLenChars :: Int -> [Char] -> ByteString
349
-unsafePackLenChars len cs =
350
+unsafePackLenChars len =
351
(\x go p -> poke p (c2w x) >> go (p `plusPtr` 1))
352
- (\_ -> return ()) cs p0
353
{-# INLINE unsafePackLenChars #-}
354
355
0 commit comments