Skip to content
This repository was archived by the owner on Oct 14, 2025. It is now read-only.

Commit 8ffda7e

Browse files
committed
Revert order of comparisons change due to this causing regression with some data sets
1 parent b5a1ea2 commit 8ffda7e

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

src/zopfli/lz77.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -512,9 +512,8 @@ void ZopfliFindLongestMatch(ZopfliBlockState* s, const ZopfliHash* h,
512512

513513
#ifdef ZOPFLI_HASH_SAME_HASH
514514
/* Switch to the other hash once this will be more efficient. */
515-
if (h->val2 == h->hashval2[p] &&
516-
hhead != h->head2 &&
517-
bestlength >= same0) {
515+
if (hhead != h->head2 && bestlength >= same0 &&
516+
h->val2 == h->hashval2[p]) {
518517
/* Now use the hash that encodes the length and first byte. */
519518
hhead = h->head2;
520519
hprev = h->prev2;

0 commit comments

Comments
 (0)