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

Function merge_name_sets

crates/compile/src/graph.rs:19–27  ·  view source on GitHub ↗

Absorbs the elements of the smaller [`NameSet`] into the bigger one and returns the merged set.

(mut a: NameSet, mut b: NameSet)

Source from the content-addressed store, hash-verified

17/// Absorbs the elements of the smaller [`NameSet`] into the bigger one and returns
18/// the merged set.
19pub fn merge_name_sets(mut a: NameSet, mut b: NameSet) -> NameSet {
20 if a.len() < b.len() {
21 b.extend(a);
22 b
23 } else {
24 a.extend(b);
25 a
26 }
27}
28
29/// Maps each [`Name`] to the set of [`Name`]s it is associated with.
30pub type RefMap = FxHashMap<Name, NameSet>;

Callers 2

get_expr_referencesFunction · 0.85

Calls 1

lenMethod · 0.45

Tested by

no test coverage detected