diff options
author | yann.collet.73@gmail.com <yann.collet.73@gmail.com@650e7d94-2a16-8b24-b05c-7c0b3f6821cd> | 2011-10-06 11:24:04 (GMT) |
---|---|---|
committer | yann.collet.73@gmail.com <yann.collet.73@gmail.com@650e7d94-2a16-8b24-b05c-7c0b3f6821cd> | 2011-10-06 11:24:04 (GMT) |
commit | 5f0ef5bb6385e084b259d1a1202b2a92fc730562 (patch) | |
tree | 20a317ddcff535ad5e5f8b0677ab4cb76f3f0db8 | |
parent | da9037238ca0bc3a776d98c7ba3765b47089a053 (diff) | |
download | lz4-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.c | 15 |
1 files changed, 6 insertions, 9 deletions
@@ -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;
|