Skip to main content

tail_pair

Function tail_pair 

Source
pub fn tail_pair(input: &[u8], width: usize, index: usize) -> Result<(u64, u64)>
Expand description

Two neighbouring values of a run, read from one load where the pair fits inside it.

index is the later of the two and the answer is the pair at index - 1 and index. A text column asks for exactly this once per string it hands out, because a value starts where the one before it ended. Two calls to tail_at read the same eight bytes twice and do the bounds arithmetic twice, where a pair of seventeen bit offsets, which is what a block of text carries, both lie inside one load.

ยงErrors

If index is zero, if width exceeds 64, or if the pair would run past the end of input.