This caused us to double-search the first position and fail to search the
last position in the chain, slowing down search and making it less effective.
const U32 ddsMinChain = ddsSize > ddsChainSize ? ddsSize - ddsChainSize : 0;
const U32 bucketSize = (1 << DD_BLOG);
- U32 attemptNb = 0;
+ U32 attemptNb = 1;
matchIndex = dms->hashTable[ddsIdx];
break;
}
- if (attemptNb < bucketSize - 1) {
+ if (attemptNb < bucketSize) {
matchIndex = dms->hashTable[ddsIdx + attemptNb];
} else {
matchIndex = dms->chainTable[matchIndex & ddsChainMask];