Skip to main content

confine_array_index

Function confine_array_index 

Source
pub fn confine_array_index(index: usize, size: usize) -> usize
Expand description

returns index if index < size, or 0 if index >= size. Immune to speculative execution information leak bugs such as Spectre V1.