From a5990278ee3c27c55fbfa9c10ea5c7a1cf7624a4 Mon Sep 17 00:00:00 2001 From: Georgy Lukyanov Date: Thu, 28 Nov 2024 09:15:20 +0100 Subject: [PATCH] Use bang patterns on checksum --- .../src/ouroboros-consensus/Ouroboros/Consensus/Util/CBOR.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ouroboros-consensus/src/ouroboros-consensus/Ouroboros/Consensus/Util/CBOR.hs b/ouroboros-consensus/src/ouroboros-consensus/Ouroboros/Consensus/Util/CBOR.hs index 1ecdc42d10..d90c0991cd 100644 --- a/ouroboros-consensus/src/ouroboros-consensus/Ouroboros/Consensus/Util/CBOR.hs +++ b/ouroboros-consensus/src/ouroboros-consensus/Ouroboros/Consensus/Util/CBOR.hs @@ -197,11 +197,11 @@ readIncremental = \(SomeHasFS hasFS) decoder fp -> do -> CRC -> CBOR.R.IDecode (U.PrimState m) a -> m (Either ReadIncrementalErr (a, CRC)) - go hasFS@HasFS{..} h checksum (CBOR.R.Partial k) = do + go hasFS@HasFS{..} h !checksum (CBOR.R.Partial k) = do bs <- hGetSome h (fromIntegral defaultChunkSize) dec' <- U.stToIO $ k (checkEmpty bs) go hasFS h (updateCRC bs checksum) dec' - go _ _ checksum (CBOR.R.Done leftover _ a) = + go _ _ !checksum (CBOR.R.Done leftover _ a) = return $ if BS.null leftover then Right (a, checksum) else Left $ TrailingBytes leftover