From b53edb5bd7f4fb2b159c3b33afa51e7af7745dcf Mon Sep 17 00:00:00 2001 From: Bodigrim Date: Fri, 21 Aug 2020 19:03:55 +0100 Subject: [PATCH] Fix PS in findIndexEnd --- Data/ByteString.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Data/ByteString.hs b/Data/ByteString.hs index e436a0b74..34530bb46 100644 --- a/Data/ByteString.hs +++ b/Data/ByteString.hs @@ -1164,7 +1164,7 @@ findIndex k (BS x l) = accursedUnutterablePerformIO $ withForeignPtr x $ \f -> g -- -- @since 0.10.12.0 findIndexEnd :: (Word8 -> Bool) -> ByteString -> Maybe Int -findIndexEnd k (PS x s l) = accursedUnutterablePerformIO $ withForeignPtr x $ \ f -> go (f `plusPtr` s) (l-1) +findIndexEnd k (BS x l) = accursedUnutterablePerformIO $ withForeignPtr x $ \ f -> go f (l-1) where go !ptr !n | n < 0 = return Nothing | otherwise = do w <- peekByteOff ptr n