Skip to content

Commit e819263

Browse files
committed
Use unsafeDrop
Ignore-this: a5e35bb33228ace2f6f4c55f20e9eece darcs-hash:20101026223703-cef97-a8a4f42c55502a1d6fd35b8fb55104d58588302d.gz
1 parent 8f628ef commit e819263

File tree

3 files changed

+17
-3
lines changed

3 files changed

+17
-3
lines changed

CHANGES

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,15 @@
1+
2.1.0.3
2+
* Fix the .cabal to remove the test build deps unless the test flag is set
3+
4+
2.1.0.2
5+
* Use "unsafeDrop" for a small performance win. This should be automaticly recognized by the compiler some day.
6+
7+
2.1.0.1
8+
* Automatically use faster getNthWord on x86. Unpack more data types.
9+
10+
2.1.0.0
11+
* Tighen build deps
12+
113
2.0.0.0
214
* Support crypto-api classes
315
* Use crypto-api test cases

Data/Digest/Pure/MD5.hs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ module Data.Digest.Pure.MD5
3636
import Data.ByteString.Unsafe (unsafeUseAsCString)
3737
import qualified Data.ByteString as B
3838
import qualified Data.ByteString.Lazy as L
39+
import Data.ByteString.Unsafe (unsafeDrop)
3940
import Data.ByteString.Internal
4041
import Data.Bits
4142
import Data.List
@@ -121,7 +122,7 @@ blockAndDo !ctx bs
121122
| B.length bs == 0 = ctx
122123
| otherwise =
123124
let !new = performMD5Update ctx bs
124-
in blockAndDo new (B.drop blockSizeBytes bs)
125+
in blockAndDo new (unsafeDrop blockSizeBytes bs)
125126
{-# INLINE blockAndDo #-}
126127

127128
-- Assumes ByteString length == blockSizeBytes, will fold the

pureMD5.cabal

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: pureMD5
2-
version: 2.1.0.1
2+
version: 2.1.0.3
33
license: BSD3
44
license-file: LICENSE
55
author: Thomas DuBuisson <thomas.dubuisson@gmail.com>
@@ -28,6 +28,7 @@ Library
2828

2929
Executable md5Test
3030
main-is: Test/main.hs
31-
Build-Depends: base, QuickCheck, crypto-api, bytestring, cereal
31+
if flag(test)
32+
Build-Depends: base, QuickCheck, crypto-api, bytestring, cereal
3233
if !flag(test)
3334
buildable: False

0 commit comments

Comments
 (0)