File tree Expand file tree Collapse file tree 2 files changed +4
-4
lines changed
Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -134,12 +134,11 @@ unsafeIndex (ByteArray arr) i@(I# i#) =
134134 case indexWord8Array# arr i# of r# -> (W8 # r# )
135135{-# INLINE unsafeIndex #-}
136136
137- -- | 'sizeofMutableByteArray#' is deprecated, because it is unsafe in the presence of
138- -- 'shrinkMutableByteArray#' and 'resizeMutableByteArray#'.
139- --
140- -- @since 2.0
137+ -- | @since 2.0
141138getSizeofMArray :: MArray s -> ST s Int
142139getSizeofMArray (MutableByteArray marr) = ST $ \ s0# ->
140+ -- Cannot simply use (deprecated) 'sizeofMutableByteArray#', because it is
141+ -- unsafe in the presence of 'shrinkMutableByteArray#' and 'resizeMutableByteArray#'.
143142 case getSizeofMutableByteArray# marr s0# of
144143 (# s1# , word8len# # ) -> (# s1# , I # word8len# # )
145144
Original file line number Diff line number Diff line change @@ -68,6 +68,7 @@ between x y z = x >= y && x <= z
6868-- | ord c < 0x800 = 2
6969-- | ord c < 0x10000 = 3
7070-- | otherwise = 4
71+ -- Implementation suggested by Alex Mason.
7172
7273-- | @since 2.0
7374utf8Length :: Char -> Int
You can’t perform that action at this time.
0 commit comments