don't check one more offset than we need
(another thing i forgot to update after changing the tuple size)
This commit is contained in:
parent
7aa58df92f
commit
e45f993eed
1 changed files with 2 additions and 2 deletions
|
@ -465,8 +465,8 @@ backref_t ref_search (uint8_t *start, uint8_t *current, uint32_t insize, int fas
|
||||||
// see if this byte pair exists elsewhere, then start searching.
|
// see if this byte pair exists elsewhere, then start searching.
|
||||||
currbytes = COMBINE(current[3], current[2], current[1], current[0]);
|
currbytes = COMBINE(current[3], current[2], current[1], current[0]);
|
||||||
HASH_FIND_INT(offsets, &currbytes, tuple);
|
HASH_FIND_INT(offsets, &currbytes, tuple);
|
||||||
// add 2 to offset since we're starting at the end of the 3 byte sequence here
|
// add 3 to offset since we're starting at the end of the 4 byte sequence here
|
||||||
if (tuple) for (uint8_t *pos = start + tuple->offset + 2; pos < current; pos++) {
|
if (tuple) for (uint8_t *pos = start + tuple->offset + 3; pos < current; pos++) {
|
||||||
// now repeat the check but go backwards
|
// now repeat the check but go backwards
|
||||||
for (size = 0; size <= LONG_RUN_SIZE && current + size < start + insize; size++)
|
for (size = 0; size <= LONG_RUN_SIZE && current + size < start + insize; size++)
|
||||||
if (start[pos - start - size] != current[size]) break;
|
if (start[pos - start - size] != current[size]) break;
|
||||||
|
|
Loading…
Reference in a new issue