diff options
Diffstat (limited to 'compiler/GHC/Utils/Encoding.hs')
-rw-r--r-- | compiler/GHC/Utils/Encoding.hs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/compiler/GHC/Utils/Encoding.hs b/compiler/GHC/Utils/Encoding.hs index 24637a3bff..ac4d4e01e5 100644 --- a/compiler/GHC/Utils/Encoding.hs +++ b/compiler/GHC/Utils/Encoding.hs @@ -170,13 +170,13 @@ utf8DecodeShortByteString (SBS ba#) let len# = sizeofByteArray# ba# in utf8DecodeLazy# (return ()) (utf8DecodeCharByteArray# ba#) len# -countUTF8Chars :: ShortByteString -> IO Int +countUTF8Chars :: ShortByteString -> Int countUTF8Chars (SBS ba) = go 0# 0# where len# = sizeofByteArray# ba go i# n# | isTrue# (i# >=# len#) = - return (I# n#) + (I# n#) | otherwise = do case utf8DecodeCharByteArray# ba i# of (# _, nBytes# #) -> go (i# +# nBytes#) (n# +# 1#) |