Skip to content

Commit bd5f95c

Browse files
committed
f use Vec::append as suggested by Jeff
1 parent 4ce6399 commit bd5f95c

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

lightning/src/ln/channelmanager.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2991,10 +2991,7 @@ impl<ChanSigner: ChannelKeys, M: Deref + Sync + Send, T: Deref + Sync + Send, K:
29912991
channel_state.by_id.retain(|_, channel| {
29922992
let res = channel.block_connected(header, height, txn_matched, indexes_of_txn_matched);
29932993
if let Ok((chan_res, mut timed_out_pending_htlcs)) = res {
2994-
timed_out_htlcs.reserve(timed_out_pending_htlcs.len());
2995-
for (htlc_src, payment_hash, value) in timed_out_pending_htlcs.drain(..) {
2996-
timed_out_htlcs.push((htlc_src, payment_hash, value));
2997-
}
2994+
timed_out_htlcs.append(&mut timed_out_pending_htlcs);
29982995
if let Some(funding_locked) = chan_res {
29992996
pending_msg_events.push(events::MessageSendEvent::SendFundingLocked {
30002997
node_id: channel.get_their_node_id(),

0 commit comments

Comments
 (0)