changed computation for readability

This commit is contained in:
Paul Cruz 2017-06-20 09:50:28 -07:00
parent 4a4f9ba262
commit 6f17de2132

View File

@ -697,11 +697,14 @@ static U32 generateSequences(U32* seed, frame_t* frame, seqStore_t* seqStore,
}
} while (((!info.useDict) && (offset > (size_t)((BYTE*)srcPtr - (BYTE*)frame->srcStart))) || offset == 0);
{ size_t j;
{
size_t j;
BYTE* const dictEnd = info.dictContent + info.dictContentSize;
for (j = 0; j < matchLen; j++) {
if ((void*)(srcPtr - offset) < (void*)frame->srcStart) {
/* copy from dictionary instead of literals */
*srcPtr = *(info.dictContent + info.dictContentSize - (offset-(srcPtr-(BYTE*)frame->srcStart)));
size_t dictOffset = offset - (srcPtr - (BYTE*)frame->srcStart);
*srcPtr = *(dictEnd - dictOffset);
}
else {
*srcPtr = *(srcPtr-offset);