MCPcopy Create free account
hub / github.com/SharpCoder/teensycore / get

Method get

src/system/map.rs:116–132  ·  view source on GitHub ↗
(&self, target: &K)

Source from the content-addressed store, hash-verified

114
115impl <K : PartialOrd + PartialEq, V> BTree<K, V> for MapNode<K, V> {
116 fn get(&self, target: &K) -> Option<&V> {
117 if &self.key == target {
118 return Some(&self.item);
119 } else if &self.key > target {
120 // Go left
121 return match self.left {
122 None => None,
123 Some(node) => unsafe { node.as_ref().unwrap() }.get(target)
124 };
125 } else {
126 // Go right
127 return match self.right {
128 None => None,
129 Some(node) => unsafe { node.as_ref().unwrap() }.get(target)
130 };
131 }
132 }
133
134 fn get_mut(&mut self, target: &K) -> Option<&mut V> {
135 if &self.key == target {

Callers 9

processMethod · 0.45
when_condFunction · 0.45
test_splitFunction · 0.45
emitMethod · 0.45
index_ofMethod · 0.45
splitMethod · 0.45
eqMethod · 0.45
partial_cmpMethod · 0.45
test_splitFunction · 0.45

Calls

no outgoing calls

Tested by 2

test_splitFunction · 0.36
test_splitFunction · 0.36