Simplify #ifdef/#endif in glz code

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Jonathon Jongsma <jjongsma@redhat.com>
This commit is contained in:
Frediano Ziglio 2016-05-17 16:22:44 +01:00
parent 3349610652
commit fb10f5bf52

View File

@ -409,26 +409,21 @@ match: // RLE or dictionary (both are encoded by distance from ref (-1) a
/* update the hash at match boundary */
#if defined(LZ_RGB16) || defined(LZ_RGB24) || defined(LZ_RGB32)
if (ip > anchor) {
if (ip > anchor)
#endif
{
HASH_FUNC(hval, ip);
UPDATE_HASH(encoder->dict, hval, seg_idx, ip - ((PIXEL *)seg->lines));
ip++;
#if defined(LZ_RGB16) || defined(LZ_RGB24) || defined(LZ_RGB32)
} else {ip++;
}
#endif
ip++;
#if defined(LZ_RGB24) || defined(LZ_RGB32)
if (ip > anchor) {
if (ip > anchor)
#endif
{
HASH_FUNC(hval, ip);
UPDATE_HASH(encoder->dict, hval, seg_idx, ip - ((PIXEL *)seg->lines));
ip++;
#if defined(LZ_RGB24) || defined(LZ_RGB32)
} else {
ip++;
}
#endif
ip++;
/* assuming literal copy */
encode_copy_count(encoder, MAX_COPY - 1);
continue;