Skip to main content

contenders

Function contenders 

Source
fn contenders<F>(candidates: &mut [(u64, SmallVec<[u8; 48]>)], cmp: F) -> u64
where F: Fn(&(u64, SmallVec<[u8; 48]>), &(u64, SmallVec<[u8; 48]>)) -> Ordering,
Expand description

Counts candidates contending for a slot another candidate already claims.

Sorting is what makes contenders adjacent; the comparator names the half of the pair that decides the slot, the short id for a reinstatement and the identity for a promotion.