countMatchPtr

private fnsize_t countMatchPtr(const(ubyte) * p1, const(ubyte) * p2, size_t maxLen, const(ubyte) * end1, const(ubyte) * end2) pure nothrow @nogc

Count matching bytes between two raw pointers, with a maximum length.

This is the pointer-based equivalent of countMatch, designed for use in the no-GC fast path.

Parameters

p1Pointer to the first byte sequence.
p2Pointer to the second byte sequence.
maxLenMaximum number of bytes to compare.
end1Pointer past the end of the first sequence (for bounds checking).
end2Pointer past the end of the second sequence (for bounds checking).

Returns

The number of consecutive matching bytes.