Skip to content

Commit

Permalink
Add missing INLINE pragmas
Browse files Browse the repository at this point in the history
  • Loading branch information
Cole Miller committed Aug 22, 2020
1 parent 41bbcf1 commit 9453694
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 @@ -225,6 +225,7 @@ indexMaybe :: ShortByteString -> Int -> Maybe Word8
indexMaybe sbs i
| i >= 0 && i < length sbs = Just $! unsafeIndex sbs i
| otherwise = Nothing
{-# INLINE indexMaybe #-}

-- | /O(1)/ 'ShortByteString' index, starting from 0, that returns 'Just' if:
--
Expand All @@ -233,6 +234,7 @@ indexMaybe sbs i
-- @since 0.11.0.0
(!?) :: ShortByteString -> Int -> Maybe Word8
(!?) = indexMaybe
{-# INLINE (!?) #-}

unsafeIndex :: ShortByteString -> Int -> Word8
unsafeIndex sbs = indexWord8Array (asBA sbs)
Expand Down

0 comments on commit 9453694

Please sign in to comment.