Skip to content

Commit

Permalink
Avoid type applications
Browse files Browse the repository at this point in the history
  • Loading branch information
hsyl20 committed Feb 1, 2024
1 parent d57e149 commit e1afdb4
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions Data/ByteString/Internal/Pure.hs
Original file line number Diff line number Diff line change
Expand Up @@ -179,8 +179,10 @@ isValidUtf8' idx !len = go 0
indexIsCont i =
-- We use a signed comparison to avoid an extra comparison with 0x80,
-- since _signed_ 0x80 is -128.
let i' = fromIntegral @Word8 @Int8 (indexWord8 i)
in i' <= (fromIntegral (0xBF :: Word8))
let
v :: Int8
v = fromIntegral (indexWord8 i)
in v <= (fromIntegral (0xBF :: Word8))

go !i
| i >= len = pure True -- done
Expand Down

0 comments on commit e1afdb4

Please sign in to comment.