Skip to content

Commit e9f3e4d

Browse files
committed
Remove unnecessary drain
1 parent c4d0560 commit e9f3e4d

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
@@ -3483,7 +3483,7 @@ impl<SP: Deref> ChannelContext<SP> where SP::Target: SignerProvider {
34833483
}
34843484
bitcoin_tx.txid
34853485
};
3486-
let mut htlcs_cloned: Vec<_> = commitment_stats.htlcs_included.iter().map(|htlc| (htlc.0.clone(), htlc.1.map(|h| h.clone()))).collect();
3486+
let htlcs_cloned: Vec<_> = commitment_stats.htlcs_included.iter().map(|htlc| (htlc.0.clone(), htlc.1.map(|h| h.clone()))).collect();
34873487

34883488
// If our counterparty updated the channel fee in this commitment transaction, check that
34893489
// they can actually afford the new fee now.
@@ -3536,7 +3536,7 @@ impl<SP: Deref> ChannelContext<SP> where SP::Target: SignerProvider {
35363536

35373537
let mut nondust_htlc_sources = Vec::with_capacity(htlcs_cloned.len());
35383538
let mut htlcs_and_sigs = Vec::with_capacity(htlcs_cloned.len());
3539-
for (idx, (htlc, mut source_opt)) in htlcs_cloned.drain(..).enumerate() {
3539+
for (idx, (htlc, mut source_opt)) in htlcs_cloned.into_iter().enumerate() {
35403540
if let Some(_) = htlc.transaction_output_index {
35413541
let htlc_tx = chan_utils::build_htlc_transaction(&commitment_txid, commitment_stats.feerate_per_kw,
35423542
funding.get_counterparty_selected_contest_delay().unwrap(), &htlc, &self.channel_type,

0 commit comments

Comments
 (0)