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