Function glidesort::sort_with_vec_by
source · pub fn sort_with_vec_by<T, F>(v: &mut [T], scratch_buf: &mut Vec<T>, compare: F)where
F: FnMut(&T, &T) -> Ordering,
Expand description
Like sort_by
, except this function allocates its scratch space with scratch_buf.reserve(_)
.
This allows you to re-use the same allocation many times.