MCPcopy Create free account
hub / github.com/argumentcomputer/ix / build_ref_graph_array

Function build_ref_graph_array

crates/ffi/src/graph.rs:17–35  ·  view source on GitHub ↗

Build an Array (Ix.Name × Array Ix.Name) from a RefMap.

(
  cache: &mut LeanBuildCache,
  refs: &ix_compile::graph::RefMap,
)

Source from the content-addressed store, hash-verified

15
16/// Build an Array (Ix.Name × Array Ix.Name) from a RefMap.
17pub fn build_ref_graph_array(
18 cache: &mut LeanBuildCache,
19 refs: &ix_compile::graph::RefMap,
20) -> LeanArray<LeanOwned> {
21 let arr = LeanArray::alloc(refs.len());
22 for (i, (name, ref_set)) in refs.iter().enumerate() {
23 let name_obj = LeanIxName::build(cache, name);
24
25 let refs_arr = LeanArray::alloc(ref_set.len());
26 for (j, ref_name) in ref_set.iter().enumerate() {
27 let ref_name_obj = LeanIxName::build(cache, ref_name);
28 refs_arr.set(j, ref_name_obj);
29 }
30
31 let pair = LeanProd::new(name_obj, refs_arr);
32 arr.set(i, pair);
33 }
34 arr
35}
36
37impl LeanIxCondensedBlocks<LeanOwned> {
38 /// Build a RustCondensedBlocks structure.

Callers 1

rs_build_ref_graphFunction · 0.85

Calls 2

lenMethod · 0.45
iterMethod · 0.45

Tested by

no test coverage detected