diff options
author | Pixel <pixel@nobis-crew.org> | 2008-09-26 18:12:42 -0700 |
---|---|---|
committer | Pixel <pixel@nobis-crew.org> | 2008-09-26 18:12:42 -0700 |
commit | 1cf900a817761badd343b69918101074c45e4e56 (patch) | |
tree | 95af20752c909af862faf920b39317689b6cff18 | |
parent | 4a84d6f13637f5867ecfaea29446a69278e9afcf (diff) |
Increasing buffersize of the HashFunction, and removing the lock.
-rw-r--r-- | lib/HashFunction.cc | 8 |
1 files changed, 2 insertions, 6 deletions
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() { |