summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYann Collet <cyan@fb.com>2017-10-31 19:22:15 (GMT)
committerYann Collet <cyan@fb.com>2017-10-31 19:22:15 (GMT)
commitace334a4c94927d97933888b343a2f435bbbc7fa (patch)
tree61c43573feedde2caf65078c07c56deccaa3e0e0
parent3f173052aef1d0f1503bd986cc871e59ef56cadd (diff)
downloadlz4-ace334a4c94927d97933888b343a2f435bbbc7fa.zip
lz4-ace334a4c94927d97933888b343a2f435bbbc7fa.tar.gz
lz4-ace334a4c94927d97933888b343a2f435bbbc7fa.tar.bz2
minor : coding style : use ML_MASK constant
-rw-r--r--lib/lz4.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/lz4.c b/lib/lz4.c
index b036d98..34d8c40 100644
--- a/lib/lz4.c
+++ b/lib/lz4.c
@@ -1185,12 +1185,12 @@ LZ4_FORCE_INLINE int LZ4_decompress_generic(
* this shortcut was tested on x86 and x64, where it improves decoding speed.
* it has not yet been benchmarked on ARM, Power, mips, etc. */
if (((ip + 14 + 2 <= iend) & (op + 14 + 16 <= oend))
- & ((token < (15<<ML_BITS)) & ((token & 0xF) <= 12)) ) {
+ & ((token < (15<<ML_BITS)) & ((token & ML_MASK) <= 12)) ) {
size_t const ll = token >> ML_BITS;
size_t const off = LZ4_readLE16(ip+ll);
const BYTE* const matchPtr = op + ll - off; /* pointer underflow risk ? */
if ((off >= 16) /* do not deal with overlapping matches */ & (matchPtr >= lowPrefix)) {
- size_t const ml = (token & 0xF) + MINMATCH;
+ size_t const ml = (token & ML_MASK) + MINMATCH;
memcpy(op, ip, 16); op += ll; ip += ll + 2 /*offset*/;
memcpy(op, matchPtr, 16); op += ml;
continue;