5 ms·
It seems to me there's a couple of other assumptions in there, too: 1) the string_view is null terminated (not required by string_view, not a safe assumption in
by hermitdev 4y ago
It seems to me there's a couple of other assumptions in there, too: 1) the string_view is null terminated (not required by string_view, not a safe assumption in general) and 2) that any padding is zero-initialized (don't think this is required, either).
- benmmurphy 4y agoThe padding doesn’t have to be 0 because the comparisons are masked off so the padding bytes are not included. Also, there is no null termination assumption. Though, I guess the last ‘fastest’ example does have the null terminator assumption but this should be assumed because it did assume zero padding. The only other assumption is that 8 bytes can be safely read and this is assumed in the original post. There might be an endian assumption.