Skip to content

Commit ba60b04

Browse files
committed
Remove unnecessary drain
1 parent 030a784 commit ba60b04

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lightning/src/ln/channel.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3505,7 +3505,7 @@ impl<SP: Deref> ChannelContext<SP> where SP::Target: SignerProvider {
35053505
}
35063506
bitcoin_tx.txid
35073507
};
3508-
let mut htlcs_cloned: Vec<_> = commitment_data.htlcs_included.iter().map(|htlc| (htlc.0.clone(), htlc.1.map(|h| h.clone()))).collect();
3508+
let htlcs_cloned: Vec<_> = commitment_data.htlcs_included.iter().map(|htlc| (htlc.0.clone(), htlc.1.map(|h| h.clone()))).collect();
35093509

35103510
// If our counterparty updated the channel fee in this commitment transaction, check that
35113511
// they can actually afford the new fee now.
@@ -3559,7 +3559,7 @@ impl<SP: Deref> ChannelContext<SP> where SP::Target: SignerProvider {
35593559
let mut nondust_htlc_sources = Vec::with_capacity(htlcs_cloned.len());
35603560
let mut htlcs_and_sigs = Vec::with_capacity(htlcs_cloned.len());
35613561
let holder_keys = commitment_data.stats.tx.trust().keys();
3562-
for (idx, (htlc, mut source_opt)) in htlcs_cloned.drain(..).enumerate() {
3562+
for (idx, (htlc, mut source_opt)) in htlcs_cloned.into_iter().enumerate() {
35633563
if let Some(_) = htlc.transaction_output_index {
35643564
let htlc_tx = chan_utils::build_htlc_transaction(&commitment_txid, commitment_data.stats.tx.feerate_per_kw(),
35653565
funding.get_counterparty_selected_contest_delay().unwrap(), &htlc, &self.channel_type,

0 commit comments

Comments
 (0)