Function tor_config::load::intersect_unrecognized_lists
source · fn intersect_unrecognized_lists(
al: BTreeSet<DisfavouredKey>,
bl: BTreeSet<DisfavouredKey>
) -> BTreeSet<DisfavouredKey>
Expand description
Computes the intersection, resolving ignorances at different depths
Eg if a
contains application.wombat
and b
contains application
,
we need to return application.wombat
.
§Formally
A configuration key (henceforth “key”) is a sequence of PathEntry
,
interpreted as denoting a place in a tree-like hierarchy.
Each input BTreeSet
denotes a subset of the configuration key space.
Any key in the set denotes itself, but also all possible keys which have it as a prefix.
We say a s set is “minimal” if it doesn’t have entries made redundant by this rule.
This function computes a minimal intersection of two minimal inputs.
If the inputs are not minimal, the output may not be either
(although serde_ignored
gives us minimal sets, so that case is not important).