summaryrefslogtreecommitdiff
path: root/lzf_c.c
diff options
context:
space:
mode:
authorroot <root>2007-11-13 08:17:38 +0000
committerroot <root>2007-11-13 08:17:38 +0000
commita097fcd099d2e2bb649a1de8e0e10909ac470770 (patch)
tree4f6b189b1f1259de34effc0c660745636b4db5ed /lzf_c.c
parent29dff116a202a0a7f7dc2a1e34db43c4263ebf8e (diff)
unroll a bit for testing
Diffstat (limited to 'lzf_c.c')
-rw-r--r--lzf_c.c25
1 files changed, 21 insertions, 4 deletions
diff --git a/lzf_c.c b/lzf_c.c
index 5b42a36..554e996 100644
--- a/lzf_c.c
+++ b/lzf_c.c
@@ -160,10 +160,6 @@ lzf_compress (const void *const in_data, unsigned int in_len,
if (expect_false (op + lit + 1 + 3 >= out_end))
return 0;
- do
- len++;
- while (len < maxlen && ref[len] == ip[len]);
-
if (lit)
{
*op++ = lit - 1;
@@ -173,6 +169,27 @@ lzf_compress (const void *const in_data, unsigned int in_len,
while (++lit);
}
+ for (;;)
+ {
+ if (expect_true (ip < in_end - 2 - 8 && maxlen > 8))
+ {
+ len++; if (ref [len] != ip [len]) break;
+ len++; if (ref [len] != ip [len]) break;
+ len++; if (ref [len] != ip [len]) break;
+ len++; if (ref [len] != ip [len]) break;
+ len++; if (ref [len] != ip [len]) break;
+ len++; if (ref [len] != ip [len]) break;
+ len++; if (ref [len] != ip [len]) break;
+ len++; if (ref [len] != ip [len]) break;
+ }
+
+ do
+ len++;
+ while (len < maxlen && ref[len] == ip[len]);
+
+ break;
+ }
+
len -= 2;
ip++;