fn add_related_nodes(
    visited: &mut FnvHashSet<StringKey>,
    result: &mut FnvHashMap<StringKey, ExecutableDefinition>,
    trees: &FnvHashMap<StringKey, Node>,
    base_definition_names: &FnvHashSet<StringKey>,
    key: StringKey,
) {
    if !visited.insert(key) {
        return;
    }

    let parents = match trees.get(&key) {
        None => {
            panic!("Fragment {:?} not found in IR.", key);
        }
        Some(node) => &node.parents,
    };
    if parents.is_empty() {
        if !base_definition_names.contains(&key) {
            add_descendants(result, trees, key);
        }
    } else {
        for parent in parents {
            add_related_nodes(visited, result, trees, base_definition_names, *parent);
        }
    }
}
// From `key` of changed definition, recusively traverse up the depenency tree, and add all related nodes (ancestors
// of changned definitions which are not from base definitions, and all of their desendants) into the `result`
From `key` of changed definition, recusively traverse up the depenency tree, and add all related nodes (ancestors
of changned definitions which are not from base definitions, and all of their desendants) into the `result`
From ` key ` of changed definition recusively traverse up the depenency tree and add all related nodes ( ancestors of changned definitions which are not from base definitions and all of their desendants ) into the ` result `
fn add_related_nodes(
    visited: &mut FnvHashSet<StringKey>,
    result: &mut FnvHashMap<StringKey, ExecutableDefinition>,
    trees: &FnvHashMap<StringKey, Node>,
    base_definition_names: &FnvHashSet<StringKey>,
    key: StringKey,
) {
    if !visited.insert(key) {
        return;
    }
    let parents = match trees.get(&key) {
        None => {
            panic!("Fragment {:?} not found in IR.", key);
        }
        Some(node) => &node.parents,
    };
    if parents.is_empty() {
        if !base_definition_names.contains(&key) {
            add_descendants(result, trees, key);
        }
    } else {
        for parent in parents {
            add_related_nodes(visited, result, trees, base_definition_names, *parent);
        }
    }
}
fn add_related_nodes ( visited : & mut FnvHashSet < StringKey > , result : & mut FnvHashMap < StringKey , ExecutableDefinition > , trees : & FnvHashMap < StringKey , Node > , base_definition_names : & FnvHashSet < StringKey > , key : StringKey , ) { if ! visited . insert ( key ) { return ; } let parents = match trees . get ( & key ) { None => { panic ! ( " " key ) ; } Some ( node ) => & node . parents , } ; if parents . is_empty ( ) { if ! base_definition_names . contains ( & key ) { add_descendants ( result , trees , key ) ; } } else { for parent in parents { add_related_nodes ( visited , result , trees , base_definition_names , * parent ) ; } } }
From `key` of changed definition, recusively traverse up the depenency tree, and add all related nodes (ancestors
of changned definitions which are not from base definitions, and all of their desendants) into the `result`
From ` key ` of changed definition recusively traverse up the depenency tree and add all related nodes ( ancestors of changned definitions which are not from base definitions and all of their desendants ) into the ` result `
visited
&mut FnvHashSet<StringKey>
result
&mut FnvHashMap<StringKey, ExecutableDefinition>
trees
&FnvHashMap<StringKey, Node>
base_definition_names
&FnvHashSet<StringKey>
key
StringKey
visited
&mut FnvHashSet<StringKey>
result
&mut FnvHashMap<StringKey, ExecutableDefinition>
trees
&FnvHashMap<StringKey, Node>
base_definition_names
&FnvHashSet<StringKey>
key
StringKey