Skip to content
Snippets Groups Projects
Commit 8783bfbf authored by Scott Vokes's avatar Scott Vokes
Browse files

Same optimization as 38b80258, non-indexed.

Only check for matches that can be improvements.
parent aa42d75a
No related branches found
No related tags found
No related merge requests found
......@@ -535,7 +535,8 @@ static uint16_t find_longest_match(heatshrink_encoder *hse, uint16_t start,
#else
for (int16_t pos=end - 1; pos >= start; pos--) {
uint8_t * const pospoint = &buf[pos];
if (*pospoint == *needlepoint) {
if ((pospoint[match_maxlen] == needlepoint[match_maxlen])
&& (*pospoint == *needlepoint)) {
for (len=1; len<maxlen; len++) {
if (0) {
LOG(" --> cmp buf[%d] == 0x%02x against %02x (start %u)\n",
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment