Skip to content

Commit

Permalink
clippy: remove .any(|x| x) construction in the compiler
Browse files Browse the repository at this point in the history
  • Loading branch information
apoelstra committed Nov 9, 2024
1 parent acbd120 commit 26e96f1
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/policy/compiler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -693,11 +693,10 @@ fn insert_elem<Pk: MiniscriptKey, Ctx: ScriptContext>(
// cost, don't consider this element.
let is_worse = map
.iter()
.map(|(existing_key, existing_elem)| {
.any(|(existing_key, existing_elem)| {
let existing_elem_cost = existing_elem.cost_1d(sat_prob, dissat_prob);
existing_key.is_subtype(elem_key) && existing_elem_cost <= elem_cost
})
.any(|x| x);
});
if !is_worse {
// If the element is not worse any element in the map, remove elements
// whose subtype is the current element and have worse cost.
Expand Down

0 comments on commit 26e96f1

Please sign in to comment.