- num_matches += do_search(mf->base.cur_window,
- mf->base.cur_window_pos,
- mf->child_tab,
- cur_match,
- min_len,
- min(bytes_remaining, mf->base.params.nice_match_len),
- mf->base.params.max_search_depth,
- &matches[num_matches]);
-
- /* If the longest match is @nice_match_len in length, it may have been
- * truncated. Try extending it up to the maximum match length. */
- if (num_matches != 0 &&
- matches[num_matches - 1].len == mf->base.params.nice_match_len)
- {
- const u8 * const strptr = lz_mf_get_window_ptr(&mf->base);
- const u8 * const matchptr = strptr - matches[num_matches - 1].offset;
- const u32 len_limit = min(bytes_remaining, mf->base.params.max_match_len);
- u32 len;
-
- len = matches[num_matches - 1].len;
- while (len < len_limit && strptr[len] == matchptr[len])
- len++;
- matches[num_matches - 1].len = len;
- }
-
-out:
- /* Advance to the next position. */
- mf->base.cur_window_pos++;
+ lz_matchptr = do_search(window,
+ cur_pos,
+ mf->child_tab,
+ cur_match,
+ min_len,
+ nice_len,
+ max_len,
+ mf->base.params.max_search_depth,
+ lz_matchptr);