Skip to content

Commit 6b51427

Browse files
committed
Use unsigned for hash
1 parent cf04a1a commit 6b51427

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/function/LZCodec.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -370,7 +370,7 @@ bool LZPCodec::forward(SliceArray<byte>& input, SliceArray<byte>& output, int co
370370
int minRef = 4;
371371

372372
while ((srcIdx < srcEnd) && (dstIdx < dstEnd)) {
373-
const int32 h = (HASH_SEED * ctx) >> HASH_SHIFT;
373+
const uint32 h = (HASH_SEED * ctx) >> HASH_SHIFT;
374374
const int32 ref = _hashes[h];
375375
_hashes[h] = srcIdx;
376376
int bestLen = 0;
@@ -422,7 +422,7 @@ bool LZPCodec::forward(SliceArray<byte>& input, SliceArray<byte>& output, int co
422422
}
423423

424424
while ((srcIdx < srcEnd + 8) && (dstIdx < dstEnd)) {
425-
const int32 h = (HASH_SEED * ctx) >> HASH_SHIFT;
425+
const uint32 h = (HASH_SEED * ctx) >> HASH_SHIFT;
426426
const int ref = _hashes[h];
427427
_hashes[h] = srcIdx;
428428
const int val = int32(src[srcIdx]);

0 commit comments

Comments
 (0)