aboutsummaryrefslogtreecommitdiff
path: root/src/pklib/implode.c
diff options
context:
space:
mode:
authorLadislav Zezula <zezula@volny.cz>2022-04-19 07:26:44 +0200
committerGitHub <noreply@github.com>2022-04-19 07:26:44 +0200
commit460354d98bc266507befe517f9f246d3b952abc9 (patch)
treedb6584e42a78b00672ba95bdf4b33b508300f448 /src/pklib/implode.c
parent8099c8ccb88319e6d1fa2359841a8af09aa3c8c1 (diff)
parent1306240979a0cb83c16773b1a91d27f2182da61f (diff)
Merge pull request #252 from ladislav-zezula/LZ_PkLibOptimizations
Incorporated PKLIB optimizations by pionere (https://github.com/pionere).
Diffstat (limited to 'src/pklib/implode.c')
-rw-r--r--src/pklib/implode.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/src/pklib/implode.c b/src/pklib/implode.c
index 1484ee2..96baf98 100644
--- a/src/pklib/implode.c
+++ b/src/pklib/implode.c
@@ -599,13 +599,11 @@ unsigned int PKEXPORT implode(
unsigned int *dsize)
{
TCmpStruct * pWork = (TCmpStruct *)work_buf;
- unsigned int nChCode;
unsigned int nCount;
unsigned int i;
int nCount2;
// Fill the work buffer information
- // Note: The caller must zero the "work_buff" before passing it to implode
pWork->read_buf = read_buf;
pWork->write_buf = write_buf;
pWork->dsize_bytes = *dsize;
@@ -638,11 +636,10 @@ unsigned int PKEXPORT implode(
switch(*type)
{
case CMP_BINARY: // We will compress data with binary compression type
- for(nChCode = 0, nCount = 0; nCount < 0x100; nCount++)
+ for(nCount = 0; nCount < 0x100; nCount++)
{
pWork->nChBits[nCount] = 9;
- pWork->nChCodes[nCount] = (unsigned short)nChCode;
- nChCode = (nChCode & 0x0000FFFF) + 2;
+ pWork->nChCodes[nCount] = nCount * 2;
}
break;