Skip to content

Commit 470112b

Browse files
f - Avoid unnecessary extra allocation
1 parent 71334fa commit 470112b

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
@@ -3099,7 +3099,7 @@ impl<Signer: Sign, M: Deref, T: Deref, K: Deref, F: Deref, L: Deref> ChannelMana
30993099
let channel_state = &mut *channel_state_lock;
31003100

31013101
let mut forward_htlcs = HashMap::new();
3102-
mem::swap(&mut forward_htlcs, &mut self.forward_htlcs.lock().unwrap().drain().collect());
3102+
mem::swap(&mut forward_htlcs, &mut self.forward_htlcs.lock().unwrap());
31033103

31043104
for (short_chan_id, mut pending_forwards) in forward_htlcs {
31053105
if short_chan_id != 0 {

0 commit comments

Comments
 (0)