summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorYann Collet <Cyan4973@users.noreply.github.com>2018-07-17 13:42:48 (GMT)
committerGitHub <noreply@github.com>2018-07-17 13:42:48 (GMT)
commite95781dc2a30953a37d812175bf4fc8f0af7143a (patch)
tree0ebc5b78b93e107e3f156e11b5b8a32826244cec /lib
parentbfcd9c64a55a4f68dbceb08c8520bfbaefb3b025 (diff)
parente778db373b67ce15311b783c49b1d054293ce2af (diff)
downloadlz4-e95781dc2a30953a37d812175bf4fc8f0af7143a.zip
lz4-e95781dc2a30953a37d812175bf4fc8f0af7143a.tar.gz
lz4-e95781dc2a30953a37d812175bf4fc8f0af7143a.tar.bz2
Merge pull request #547 from jennifermliu/dev
Add --fast command to cli
Diffstat (limited to 'lib')
-rw-r--r--lib/lz4frame.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/lz4frame.c b/lib/lz4frame.c
index e1d0b1d..08bf0fa 100644
--- a/lib/lz4frame.c
+++ b/lib/lz4frame.c
@@ -738,7 +738,7 @@ static size_t LZ4F_makeBlock(void* dst, const void* src, size_t srcSize,
static int LZ4F_compressBlock(void* ctx, const char* src, char* dst, int srcSize, int dstCapacity, int level, const LZ4F_CDict* cdict)
{
- int const acceleration = (level < -1) ? -level : 1;
+ int const acceleration = (level < 0) ? -level + 1 : 1;
LZ4F_initStream(ctx, cdict, level, LZ4F_blockIndependent);
if (cdict) {
return LZ4_compress_fast_continue((LZ4_stream_t*)ctx, src, dst, srcSize, dstCapacity, acceleration);
@@ -749,7 +749,7 @@ static int LZ4F_compressBlock(void* ctx, const char* src, char* dst, int srcSize
static int LZ4F_compressBlock_continue(void* ctx, const char* src, char* dst, int srcSize, int dstCapacity, int level, const LZ4F_CDict* cdict)
{
- int const acceleration = (level < -1) ? -level : 1;
+ int const acceleration = (level < 0) ? -level + 1 : 1;
(void)cdict; /* init once at beginning of frame */
return LZ4_compress_fast_continue((LZ4_stream_t*)ctx, src, dst, srcSize, dstCapacity, acceleration);
}