decode_mut

Function decode_mut 

Source
pub fn decode_mut<T: Ord>(xs: &mut [T], p: usize)
Expand description

Applies the multiset permutation of the value p to the slice xs.

The applied multiset permutation can be encoded with encode to get back p.

decode_mut(&mut xs, p);
assert_eq!(encode(&xs), p);

See decode for a version that allocates a vector for the permutation.

ยงPanics

Panics in debug mode if xs is not non-decreasing or p is out of range.