From 0734e5bbe64e1daeaea74cc29a6631d84cf6c3e1 Mon Sep 17 00:00:00 2001 From: Clint Adams Date: Sun, 30 Jun 2019 11:02:27 -0400 Subject: switch crc24Lazy to use foldl' --- Data/Digest/CRC24.hs | 4 ++-- bench/mark.hs | 6 ++++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/Data/Digest/CRC24.hs b/Data/Digest/CRC24.hs index e8eec92..4fbb9b1 100644 --- a/Data/Digest/CRC24.hs +++ b/Data/Digest/CRC24.hs @@ -1,5 +1,5 @@ -- CRC24.hs: OpenPGP (RFC4880) CRC24 implementation --- Copyright © 2012 Clint Adams +-- Copyright © 2012-2019 Clint Adams -- This software is released under the terms of the ISC license. -- (See the LICENSE file). @@ -27,4 +27,4 @@ crc24 :: B.ByteString -> Word32 crc24 bs = crc24Lazy . BL.fromChunks $ [bs] crc24Lazy :: ByteString -> Word32 -crc24Lazy = BL.foldl crc24Update crc24Init +crc24Lazy = BL.foldl' crc24Update crc24Init diff --git a/bench/mark.hs b/bench/mark.hs index 8251823..cf1f20f 100644 --- a/bench/mark.hs +++ b/bench/mark.hs @@ -1,5 +1,5 @@ -- mark.hs: openpgp-asciiarmor benchmark suite --- Copyright © 2018 Clint Adams +-- Copyright © 2018-2019 Clint Adams -- This software is released under the terms of the ISC license. -- (See the LICENSE file). @@ -11,6 +11,8 @@ import Data.Digest.CRC24 main :: IO () main = defaultMain [ - bgroup "crc" [ bench "crc24" $ whnf crc24 "test" + bgroup "crc" [ + bench "crc24" $ whnf crc24 "test" + , bench "crc24Lazy" $ whnf crc24Lazy "test" ] ] -- cgit v1.2.3