From 2992d7e03f971b6f8688c847611e5bf3fe668894 Mon Sep 17 00:00:00 2001 From: Kevin Quick Date: Sat, 23 Mar 2024 21:05:54 -0700 Subject: [PATCH] Bit testing can use unsafeRead because the length was verified --- src/Data/Graph/Haggle/Internal/BitSet.hs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/Data/Graph/Haggle/Internal/BitSet.hs b/src/Data/Graph/Haggle/Internal/BitSet.hs index 3e9d1ad..1b1c393 100644 --- a/src/Data/Graph/Haggle/Internal/BitSet.hs +++ b/src/Data/Graph/Haggle/Internal/BitSet.hs @@ -44,6 +44,5 @@ testBit (BS v sz) bitIx | otherwise = do let wordIx = bitIx `div` bitsPerWord bitPos = bitIx `mod` bitsPerWord - w <- V.read v wordIx + w <- V.unsafeRead v wordIx return $ B.testBit w bitPos -