summaryrefslogtreecommitdiffstats
path: root/lib/lz4opt.h
diff options
context:
space:
mode:
authorPrzemyslaw Skibinski <inikep@gmail.com>2016-12-07 14:49:45 (GMT)
committerPrzemyslaw Skibinski <inikep@gmail.com>2016-12-07 14:49:45 (GMT)
commit8bfa42e61e65152fbe6f62eedb3c15ad7b034260 (patch)
tree1e63e7b4fefe63ea5bbb20045107beb5a3b38b3a /lib/lz4opt.h
parent1289038240ab81aee4cc70ef071da907ccfdfcde (diff)
downloadlz4-8bfa42e61e65152fbe6f62eedb3c15ad7b034260.zip
lz4-8bfa42e61e65152fbe6f62eedb3c15ad7b034260.tar.gz
lz4-8bfa42e61e65152fbe6f62eedb3c15ad7b034260.tar.bz2
improved ratio
Diffstat (limited to 'lib/lz4opt.h')
-rw-r--r--lib/lz4opt.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/lz4opt.h b/lib/lz4opt.h
index a2a9d0b..1ff3375 100644
--- a/lib/lz4opt.h
+++ b/lib/lz4opt.h
@@ -224,7 +224,7 @@ static int LZ4HC_compress_optimal (
while (mlen <= best_mlen) {
litlen = 0;
price = LZ4HC_get_price(llen + litlen, mlen) - 8*llen;
- if (mlen > last_pos || price < (size_t)opt[mlen].price)
+ if (mlen > last_pos || price <= (size_t)opt[mlen].price)
SET_PRICE(mlen, mlen, matches[i].off, litlen, price);
mlen++;
}
@@ -255,7 +255,7 @@ static int LZ4HC_compress_optimal (
mlen = 1;
best_mlen = 0;
LZ4_LOG_PARSER("%d: TRY price=%d opt[%d].price=%d\n", (int)(inr-source), price, cur, opt[cur].price);
- if (cur > last_pos || price <= (size_t)opt[cur].price) // || ((price == opt[cur].price) && (opt[cur-1].mlen == 1) && (cur != litlen)))
+ if (cur > last_pos || price < (size_t)opt[cur].price) // || ((price == opt[cur].price) && (opt[cur-1].mlen == 1) && (cur != litlen)))
SET_PRICE(cur, mlen, best_mlen, litlen, price);
if (cur == last_pos) break;