summaryrefslogtreecommitdiff
path: root/lzf_c.c
diff options
context:
space:
mode:
Diffstat (limited to 'lzf_c.c')
-rw-r--r--lzf_c.c43
1 files changed, 23 insertions, 20 deletions
diff --git a/lzf_c.c b/lzf_c.c
index 848aa22..63cf26a 100644
--- a/lzf_c.c
+++ b/lzf_c.c
@@ -222,37 +222,40 @@ lzf_compress (const void *const in_data, unsigned int in_len,
}
*op++ = off;
+ lit = 0; op++; /* start run */
+
+ ip += len + 1;
+
+ if (expect_false (ip > in_end - 2))
+ break;
- if (expect_true (ip + len < in_end - 2))
- {
#if ULTRA_FAST || VERY_FAST
- ip += len;
+ --ip;
# if VERY_FAST && !ULTRA_FAST
- --ip;
+ --ip;
# endif
- hval = FRST (ip);
+ hval = FRST (ip);
- hval = NEXT (hval, ip);
- htab[IDX (hval)] = ip;
- ip++;
+ hval = NEXT (hval, ip);
+ htab[IDX (hval)] = ip;
+ ip++;
# if VERY_FAST && !ULTRA_FAST
+ hval = NEXT (hval, ip);
+ htab[IDX (hval)] = ip;
+ ip++;
+# endif
+#else
+ ip -= len + 1;
+
+ do
+ {
hval = NEXT (hval, ip);
htab[IDX (hval)] = ip;
ip++;
-# endif
-#else
- do
- {
- hval = NEXT (hval, ip);
- htab[IDX (hval)] = ip;
- ip++;
- }
- while (len--);
-#endif
}
-
- lit = 0; op++; /* start run */
+ while (len--);
+#endif
}
else
{