if (!singleSegment) {
op[pos++] = windowByte;
}
- if(info.useDict) {
+ if (info.useDict) {
MEM_writeLE32(op + pos, (U32) info.dictID);
pos += 4;
}
}
} 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);