Skip to content

Commit

Permalink
Use bang patterns on checksum
Browse files Browse the repository at this point in the history
  • Loading branch information
geo2a committed Nov 28, 2024
1 parent 17eb0d6 commit a599027
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit a599027

Please sign in to comment.