Skip to content

Commit

Permalink
Export ‘unsafeIndex’ on short bytestrings (#532)
Browse files Browse the repository at this point in the history
(cherry picked from commit a729850)
  • Loading branch information
sergv authored and sjakobi committed Jul 25, 2022
1 parent e6a8b19 commit d47a424
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Data/ByteString/Short/Internal.hs
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ module Data.ByteString.Short.Internal (
count,
findIndex,
findIndices,
unsafeIndex,

-- * Low level operations
createFromPtr,
Expand Down Expand Up @@ -394,6 +395,7 @@ indexMaybe sbs i
(!?) = indexMaybe
{-# INLINE (!?) #-}

-- | /O(1)/ Unsafe indexing without bounds checking.
unsafeIndex :: ShortByteString -> Int -> Word8
unsafeIndex sbs = indexWord8Array (asBA sbs)

Expand Down

0 comments on commit d47a424

Please sign in to comment.