/*-************************************
* Error detection
**************************************/
+#if defined(LZ4_DEBUG) && (LZ4_DEBUG>=1)
+# include <assert.h>
+#else
+# ifndef assert
+# define assert(condition) ((void)0)
+# endif
+#endif
+
#define LZ4_STATIC_ASSERT(c) { enum { LZ4_static_assert = 1/(int)(!!(c)) }; } /* use only *after* variable declarations */
#if defined(LZ4_DEBUG) && (LZ4_DEBUG>=2)
SET_PRICE(mlen, mlen, matches[matchNb].off, 0, cost); /* updates last_match_pos and opt[pos] */
} } }
- if (last_match_pos < MINMATCH) { ip++; continue; } /* note : on clang at least, this test improves performance */
+ assert(last_match_pos >= MINMATCH);
/* check further positions */
opt[0].mlen = opt[1].mlen = 1;