countMatchWithDict

private fnsize_t countMatchWithDict( const(ubyte)[] dict, const(ubyte)[] src, size_t matchPos, size_t srcPos, size_t maxLen )

Count matching bytes when the match candidate may be in the dictionary.

This function handles the case where the match position (matchPos) may reference the dictionary (positions 0..dictLen-1) or the source data (positions dictLen..dictLen+srcLen-1). The current position (srcPos) is always in the source data.

Parameters

dictDictionary data (may be empty).
srcSource data being compressed.
matchPosPosition of the match candidate in the combined dict+src space.
srcPosCurrent position in src (0-based within src, not combined).
maxLenMaximum number of bytes to compare.

Returns

The number of consecutive matching bytes (0 to maxLen).