Lines Matching defs:index
28 // Checks if [index, index+length) is in range [0, max). Note that this check
29 // works even if {index+length} would wrap around.
32 inline constexpr bool IsInBounds(T index, T length, T max) {
33 return length <= max && index <= (max - length);
36 // Checks if [index, index+length) is in range [0, max). If not, {length} is
38 // {index+length} would wrap around.
40 inline bool ClampToBounds(T index, T* length, T max) {
41 if (index > max) {
45 T avail = max - index;