[commit: packages/bytestring] 0.10.4.x, master: Fix documented complexity of unsafePackMallocCStringLen (9f0ee6b)
git at git.haskell.org
git at git.haskell.org
Fri Jan 23 22:43:03 UTC 2015
Repository : ssh://git@git.haskell.org/bytestring
On branches: 0.10.4.x,master
Link : http://git.haskell.org/packages/bytestring.git/commitdiff/9f0ee6bf37d3a3c64c9461fb60541ed47c043d25
>---------------------------------------------------------------
commit 9f0ee6bf37d3a3c64c9461fb60541ed47c043d25
Author: Duncan Coutts <duncan at community.haskell.org>
Date: Sun Nov 9 18:44:08 2014 +0000
Fix documented complexity of unsafePackMallocCStringLen
It is indeed O(1). Spotted by polarina.
>---------------------------------------------------------------
9f0ee6bf37d3a3c64c9461fb60541ed47c043d25
Data/ByteString/Unsafe.hs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Data/ByteString/Unsafe.hs b/Data/ByteString/Unsafe.hs
index bf0ed88..cc0522a 100644
--- a/Data/ByteString/Unsafe.hs
+++ b/Data/ByteString/Unsafe.hs
@@ -250,7 +250,7 @@ unsafePackMallocCString cstr = do
len <- c_strlen cstr
return $! PS fp 0 (fromIntegral len)
--- | /O(n)/ Build a @ByteString@ from a malloced @CStringLen at . This
+-- | /O(1)/ Build a @ByteString@ from a malloced @CStringLen at . This
-- value will have a @free(3)@ finalizer associated to it.
--
-- This function is /unsafe/. If the original @CString@ is later
More information about the ghc-commits
mailing list