MCPcopy Create free account
hub / github.com/douchuan/algorithm / set

Method set

src/common/max_heap.rs:47–55  ·  view source on GitHub ↗
(&mut self, i: usize, key: K)

Source from the content-addressed store, hash-verified

45 }
46
47 pub fn set(&mut self, i: usize, key: K) {
48 match self.keys.get(i) {
49 Some(v) if &key >= v => {
50 self.keys[i] = key;
51 heap_fix(&mut self.keys, i);
52 }
53 _ => (),
54 }
55 }
56
57 pub fn insert(&mut self, key: K) {
58 let i = self.keys.len();

Callers 1

setFunction · 0.80

Calls 2

heap_fixFunction · 0.85
getMethod · 0.45

Tested by 1

setFunction · 0.64