Skip to content

Commit

Permalink
Export ‘unsafeIndex’ on short bytestrings (haskell#532)
Browse files Browse the repository at this point in the history
  • Loading branch information
sergv authored and Max Tomago committed Oct 25, 2022
1 parent 1543e05 commit 2b44c46
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 @@ -398,6 +399,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 2b44c46

Please sign in to comment.