Skip to content

Commit

Permalink
Implement pure-Haskell asciiPrefixLength
Browse files Browse the repository at this point in the history
  • Loading branch information
chreekat committed Jan 28, 2024
1 parent 97ae28a commit b070bac
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Data/Text/Internal/IsAscii.hs
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ isAscii (Text (A.ByteArray arr) off len) =
-- | Length of the longest ASCII prefix.
asciiPrefixLength :: ByteString -> Int
#if defined(PURE_HASKELL)
asciiPrefixLength = P.const 0
asciiPrefixLength = BS.length P.. BS.takeWhile (P.< 0x80)
#else
asciiPrefixLength bs = unsafeDupablePerformIO $ withBS bs $ \ fp len ->
unsafeWithForeignPtr fp $ \src -> do
Expand Down

0 comments on commit b070bac

Please sign in to comment.