garro95/priority-queue

`shrink_to_fit` does not shrink the internal IndexMap

Zannick opened this issue · 0 comments

priority-queue/src/store.rs

Lines 192 to 198 in 2bfbf45

/// Shrinks the capacity of the internal data structures
/// that support this operation as much as possible.
#[inline(always)]
pub fn shrink_to_fit(&mut self) {
self.heap.shrink_to_fit();
self.qp.shrink_to_fit();
}

But this appears to be supported by indexmap: https://docs.rs/indexmap/latest/indexmap/map/struct.IndexMap.html#method.shrink_to_fit