From 1cf900a817761badd343b69918101074c45e4e56 Mon Sep 17 00:00:00 2001 From: Pixel Date: Fri, 26 Sep 2008 18:12:42 -0700 Subject: Increasing buffersize of the HashFunction, and removing the lock. --- lib/HashFunction.cc | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'lib') diff --git a/lib/HashFunction.cc b/lib/HashFunction.cc index 9f165e4..c2cf344 100644 --- a/lib/HashFunction.cc +++ b/lib/HashFunction.cc @@ -40,16 +40,14 @@ void HashFunction::Update(const unsigned char * data, size_t len) { update(data, len); } -#define BLKSIZE 1024 +#define BLKSIZE 16384 void HashFunction::Update(Handle * h, ssize_t size) { - static Uint8 blk[BLKSIZE]; + Uint8 blk[BLKSIZE]; long r; if (size < 0) size = h->GetSize(); - LOCK; - while (size) { if ((size > BLKSIZE) || (size < 0)) { r = h->read(blk, BLKSIZE); @@ -65,8 +63,6 @@ void HashFunction::Update(Handle * h, ssize_t size) { if (size > 0) size -= r; } - - UNLOCK; } String HashFunction::Finish() { -- cgit v1.2.3