pub fn findSentinel(comptime T: type, comptime sentinel: T, p: [*:sentinel]const T) usize T: typesentinel: Tp: [*:sentinel]const T1149
1150
1151
1152
1153
1154
1155pub fn findSentinel(comptime T: type, comptime sentinel: T, p: [*:sentinel]const T) usize {
var i: usize = 0;
while (p[i] != sentinel) {
i += 1;
}
return i;
}
Returns the index of the sentinel value in a sentinel-terminated pointer. Linear search through memory until the sentinel is found.