Skip to content

Commit a7abb07

Browse files
committed
f use iters and any rather than for.
1 parent 1070da9 commit a7abb07

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

lightning/src/chain/channelmonitor.rs

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2057,13 +2057,9 @@ impl<Signer: WriteableEcdsaChannelSigner> ChannelMonitorImpl<Signer> {
20572057
&self.current_counterparty_commitment_txid.unwrap()).unwrap();
20582058
for (_, ref source_opt) in self.counterparty_claimable_outpoints.get(&txid).unwrap() {
20592059
if let Some(source) = source_opt {
2060-
let mut also_in_cur_commitment = false;
2061-
for (_, ref cur_source_opt) in cur_claimables {
2062-
if cur_source_opt == source_opt {
2063-
also_in_cur_commitment = true;
2064-
}
2065-
}
2066-
if !also_in_cur_commitment {
2060+
if !cur_claimables.iter()
2061+
.any(|(_, cur_source_opt)| cur_source_opt == source_opt)
2062+
{
20672063
self.counterparty_fulfilled_htlcs.remove(&SentHTLCId::from_source(source));
20682064
}
20692065
}

0 commit comments

Comments
 (0)