Skip to content

Commit 39bd9f2

Browse files
f - Avoid unnecessary extra allocation
1 parent c4b6b28 commit 39bd9f2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lightning/src/ln/channelmanager.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3131,7 +3131,7 @@ impl<Signer: Sign, M: Deref, T: Deref, K: Deref, F: Deref, L: Deref> ChannelMana
31313131
let channel_state = &mut *channel_state_lock;
31323132

31333133
let mut forward_htlcs = HashMap::new();
3134-
mem::swap(&mut forward_htlcs, &mut self.forward_htlcs.lock().unwrap().drain().collect());
3134+
mem::swap(&mut forward_htlcs, &mut self.forward_htlcs.lock().unwrap());
31353135

31363136
for (short_chan_id, mut pending_forwards) in forward_htlcs {
31373137
if short_chan_id != 0 {

0 commit comments

Comments
 (0)