MCPcopy Create free account
hub / github.com/ImageOptim/libimagequant / reserve

Method reserve

src/hist.rs:224–227  ·  view source on GitHub ↗
(&mut self, entries: usize)

Source from the content-addressed store, hash-verified

222 }
223
224 fn reserve(&mut self, entries: usize) {
225 let new_entries = entries.saturating_sub(self.hashmap.len() / 3); // assume some will be dupes, if called multiple times
226 self.hashmap.reserve(new_entries);
227 }
228
229 #[inline(always)]
230 const fn posterize_mask(&self) -> u32 {

Callers 2

add_imageMethod · 0.80
add_colorsMethod · 0.80

Calls 1

lenMethod · 0.45

Tested by

no test coverage detected