summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoryann.collet.73@gmail.com <yann.collet.73@gmail.com@650e7d94-2a16-8b24-b05c-7c0b3f6821cd>2011-10-06 11:24:04 (GMT)
committeryann.collet.73@gmail.com <yann.collet.73@gmail.com@650e7d94-2a16-8b24-b05c-7c0b3f6821cd>2011-10-06 11:24:04 (GMT)
commit5f0ef5bb6385e084b259d1a1202b2a92fc730562 (patch)
tree20a317ddcff535ad5e5f8b0677ab4cb76f3f0db8
parentda9037238ca0bc3a776d98c7ba3765b47089a053 (diff)
downloadlz4-5f0ef5bb6385e084b259d1a1202b2a92fc730562.zip
lz4-5f0ef5bb6385e084b259d1a1202b2a92fc730562.tar.gz
lz4-5f0ef5bb6385e084b259d1a1202b2a92fc730562.tar.bz2
code refactoring
git-svn-id: https://lz4.googlecode.com/svn/trunk@36 650e7d94-2a16-8b24-b05c-7c0b3f6821cd
-rw-r--r--lz4.c15
1 files changed, 6 insertions, 9 deletions
diff --git a/lz4.c b/lz4.c
index 9ccf0d6..a5cb605 100644
--- a/lz4.c
+++ b/lz4.c
@@ -217,16 +217,13 @@ _next_match:
// Start Counting
ip+=MINMATCH; ref+=MINMATCH; // MinMatch verified
anchor = ip;
- while (ip<matchlimit-3)
+ while (A32(ref) == A32(ip))
{
- if (A32(ref) == A32(ip)) { ip+=4; ref+=4; continue; }
- if (A16(ref) == A16(ip)) { ip+=2; ref+=2; }
- if (*ref == *ip) ip++;
- goto _endCount;
+ ip+=4; ref+=4;
+ if (ip>matchlimit-4) { ref -= ip - (matchlimit-3); ip = matchlimit-3; break; }
}
- if ((ip<(matchlimit-1)) && (A16(ref) == A16(ip))) { ip+=2; ref+=2; }
- if ((ip<matchlimit) && (*ref == *ip)) ip++;
-_endCount:
+ if (A16(ref) == A16(ip)) { ip+=2; ref+=2; }
+ if (*ref == *ip) ip++;
len = (ip - anchor);
// Encode MatchLength
@@ -526,7 +523,7 @@ int LZ4_uncompress_unknownOutputSize(
BYTE token;
- U32 dec[4]={0, 3, 2, 3};
+ U32 dec[COPYTOKEN]={0, 3, 2, 3};
int len, length;