We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
.any(|x| x)
1 parent acbd120 commit 26e96f1Copy full SHA for 26e96f1
src/policy/compiler.rs
@@ -693,11 +693,10 @@ fn insert_elem<Pk: MiniscriptKey, Ctx: ScriptContext>(
693
// cost, don't consider this element.
694
let is_worse = map
695
.iter()
696
- .map(|(existing_key, existing_elem)| {
+ .any(|(existing_key, existing_elem)| {
697
let existing_elem_cost = existing_elem.cost_1d(sat_prob, dissat_prob);
698
existing_key.is_subtype(elem_key) && existing_elem_cost <= elem_cost
699
- })
700
- .any(|x| x);
+ });
701
if !is_worse {
702
// If the element is not worse any element in the map, remove elements
703
// whose subtype is the current element and have worse cost.
0 commit comments