countMatchPtr
private fn
size_t countMatchPtr(const(ubyte) * p1, const(ubyte) * p2,
size_t maxLen,
const(ubyte) * end1, const(ubyte) * end2) pure nothrow @nogcCount 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
p1 | Pointer to the first byte sequence. |
p2 | Pointer to the second byte sequence. |
maxLen | Maximum number of bytes to compare. |
end1 | Pointer past the end of the first sequence (for bounds checking). |
end2 | Pointer past the end of the second sequence (for bounds checking). |
Returns
The number of consecutive matching bytes.