pub fn consolidate<T: Ord, R: Semigroup>(vec: &mut Vec<(T, R)>)
Expand description

Sorts and consolidates vec.

This method will sort vec and then consolidate runs of more than one entry with identical first elements by accumulating the second elements of the pairs. Should the final accumulation be zero, the element is discarded.