From 72b42284bf80a98ee256dac49ee3d917ec2f639d Mon Sep 17 00:00:00 2001 From: kwxm Date: Sat, 20 Jul 2024 05:11:08 +0100 Subject: [PATCH] Make some helpers INLINEABLE --- plutus-core/plutus-core/src/PlutusCore/Bitwise.hs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/plutus-core/plutus-core/src/PlutusCore/Bitwise.hs b/plutus-core/plutus-core/src/PlutusCore/Bitwise.hs index 42369adf238..cfb6d87a383 100644 --- a/plutus-core/plutus-core/src/PlutusCore/Bitwise.hs +++ b/plutus-core/plutus-core/src/PlutusCore/Bitwise.hs @@ -578,6 +578,8 @@ writeBits bs ixs bits = case unsafeDupablePerformIO . try $ go of where go2 :: (a -> b -> IO()) -> [a] -> [b] -> IO () go2 f (i:is) (v:vs) = f i v *> go2 f is vs go2 _ _ _ = pure () + {-# INLINEABLE go2 #-} + {-# INLINEABLE go #-} len :: Int len = BS.length bs bitLen :: Integer @@ -594,6 +596,7 @@ writeBits bs ixs bits = case unsafeDupablePerformIO . try $ go of then Bits.setBit w8 . fromIntegral $ littleIx else Bits.clearBit w8 . fromIntegral $ littleIx pokeByteOff ptr flipIx toWrite + {-# INLINEABLE setAtIx #-} -- | Byte replication, as per [CIP-122](https://github.com/cardano-foundation/CIPs/tree/master/CIP-0122) -- We want to cautious about the allocation of huge amounts of memory so we