Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix
Browse files Browse the repository at this point in the history
hsyl20 committed Dec 11, 2023

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
1 parent de18139 commit 661391d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Data/ByteString/Internal/Pure.hs
Original file line number Diff line number Diff line change
@@ -28,7 +28,7 @@ where

import Prelude

import GHC.Exts (Char(..), indexCharOffAddr#, Ptr(..), ByteArray#, indexWord8Array#, Word8#, Int#, indexWord8OffAddr#)
import GHC.Exts (Ptr(..), ByteArray#, indexWord8Array#, Word8#, Int#, indexWord8OffAddr#)
import GHC.Types (Int (..))
import GHC.Word (Word8(..))
import GHC.Int (Int8(..))
@@ -246,10 +246,10 @@ isValidUtf8' idx !len' = go 0
----------------------------------------------------------------


getDigit :: Int -> Char
getDigit (I# i) = C# (indexCharOffAddr# digits i)
getDigit :: Int -> Word8
getDigit (I# i) = W8# (indexWord8OffAddr# digits i)
where
digits = "0123456789abcdef"#
!digits = "0123456789abcdef"#

putDigit :: Ptr a -> Int -> Int -> IO ()
putDigit !addr !off !i = pokeByteOff addr off (getDigit i)

0 comments on commit 661391d

Please sign in to comment.