countMatch
private fn
size_t countMatch(const(ubyte)[] src, size_t pos1, size_t pos2, size_t maxLen)Count the number of matching bytes starting at two positions.
Compares bytes starting at pos1 and pos2 within src and returns the count of consecutive matching bytes, up to maxLen.
Parameters
src | The input buffer to search within. |
pos1 | First position to compare from. |
pos2 | Second position to compare from. |
maxLen | Maximum number of bytes to compare. |
Returns
The number of consecutive matching bytes (0 to maxLen).
private fn
size_t countMatch(const(ubyte) * srcPtr, size_t srcLen,
size_t pos1, size_t pos2, size_t maxLen) nothrow @nogcPointer-based variant of countMatch for use from @system/@trusted contexts where the source pointer and length are already available.
Parameters
srcPtr | Pointer to the start of source data. |
srcLen | Total length of the source buffer. |
pos1 | First position to compare from. |
pos2 | Second position to compare from. |
maxLen | Maximum number of bytes to compare. |
Returns
The number of consecutive matching bytes (0 to maxLen).