fn add_descendants(
    result: &mut FnvHashMap<StringKey, ExecutableDefinition>,
    trees: &FnvHashMap<StringKey, Node>,
    key: StringKey,
) {
    if result.contains_key(&key) {
        return;
    }
    match trees.get(&key) {
        Some(Node {
            ir: Some(def),
            children,
            ..
        }) => {
            result.insert(key, def.clone());
            for child in children {
                add_descendants(result, trees, *child);
            }
        }
        _ => {
            panic!("Fragment {:?} not found in IR.", key);
        }
    }
}
// Recursively add all descendants of current node into the `result`
Recursively add all descendants of current node into the `result`
Recursively add all descendants of current node into the ` result `
fn add_descendants(
    result: &mut FnvHashMap<StringKey, ExecutableDefinition>,
    trees: &FnvHashMap<StringKey, Node>,
    key: StringKey,
) {
    if result.contains_key(&key) {
        return;
    }
    match trees.get(&key) {
        Some(Node {
            ir: Some(def),
            children,
            ..
        }) => {
            result.insert(key, def.clone());
            for child in children {
                add_descendants(result, trees, *child);
            }
        }
        _ => {
            panic!("Fragment {:?} not found in IR.", key);
        }
    }
}
fn add_descendants ( result : & mut FnvHashMap < StringKey , ExecutableDefinition > , trees : & FnvHashMap < StringKey , Node > , key : StringKey , ) { if result . contains_key ( & key ) { return ; } match trees . get ( & key ) { Some ( Node { ir : Some ( def ) , children , .. } ) => { result . insert ( key , def . clone ( ) ) ; for child in children { add_descendants ( result , trees , * child ) ; } } _ => { panic ! ( " " key ) ; } } }
Recursively add all descendants of current node into the `result`
Recursively add all descendants of current node into the ` result `
result
&mut FnvHashMap<StringKey, ExecutableDefinition>
trees
&FnvHashMap<StringKey, Node>
key
StringKey
result
&mut FnvHashMap<StringKey, ExecutableDefinition>
trees
&FnvHashMap<StringKey, Node>
key
StringKey