diff options
author | Ladislav Zezula <zezula@volny.cz> | 2022-04-19 03:29:18 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-04-19 03:29:18 +0200 |
commit | c925e4ffb0008a1e417b3fcd757a9c3e66e3b2cc (patch) | |
tree | c320c2e544016ba3b86de3a1216bc7b4ea2f37fa /src/pklib/implode.c | |
parent | 8099c8ccb88319e6d1fa2359841a8af09aa3c8c1 (diff) | |
parent | f8a9f6d9afa212397c29315070fdd14f3ee05719 (diff) |
Merge pull request #251 from pionere/optimizations
Optimizations
Diffstat (limited to 'src/pklib/implode.c')
-rw-r--r-- | src/pklib/implode.c | 7 |
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; |