MCPcopy Create free account
hub / github.com/PolyhedraZK/ExpanderCompilerCollection / add

Method add

expander_compiler/src/utils/pool.rs:20–28  ·  view source on GitHub ↗
(&mut self, v: &V)

Source from the content-addressed store, hash-verified

18 }
19
20 pub fn add(&mut self, v: &V) -> usize {
21 if let Some(&idx) = self.map.get(v) {
22 return idx;
23 }
24 let idx = self.vec.len();
25 self.vec.push(v.clone());
26 self.map.insert(v.clone(), idx);
27 idx
28 }
29
30 pub fn get_idx(&self, val: &V) -> usize {
31 *self.map.get(val).expect("Pool value does not exist")

Callers 15

big_array_addMethod · 0.45
queryMethod · 0.45
solve_layer_layoutMethod · 0.45
split_circuitMethod · 0.45
split_to_single_layerFunction · 0.45
compileMethod · 0.45
newMethod · 0.45
to_singleFunction · 0.45
to_single_strippedFunction · 0.45
to_really_singleFunction · 0.45
newMethod · 0.45

Calls 4

pushMethod · 0.80
getMethod · 0.45
lenMethod · 0.45
cloneMethod · 0.45

Tested by 15

macro_kernelFunction · 0.36
macro_kernel_2Function · 0.36
macro_kernel_3Function · 0.36
from_binaryFunction · 0.36
xorFunction · 0.36
xorFunction · 0.36
check_bitsFunction · 0.36
andFunction · 0.36
defineMethod · 0.36
xorFunction · 0.36
defineMethod · 0.36
compress_bits_varFunction · 0.36