Remove redundant Vec in `get_and_clear_pending_msg_events`
authorViktor Tigerström <11711198+ViktorTigerstrom@users.noreply.github.com>
Thu, 12 Jan 2023 22:25:44 +0000 (23:25 +0100)
committerViktor Tigerström <11711198+ViktorTigerstrom@users.noreply.github.com>
Tue, 14 Feb 2023 14:03:32 +0000 (15:03 +0100)
lightning/src/ln/channelmanager.rs

index 583e8422cb756aa462273ce6fbb24a5f1df2c46b..fefa002ee7c932f101d2ea04af1af4bc9b3789c1 100644 (file)
@@ -5706,9 +5706,7 @@ where
                                let mut peer_state_lock = peer_state_mutex.lock().unwrap();
                                let peer_state = &mut *peer_state_lock;
                                if peer_state.pending_msg_events.len() > 0 {
-                                       let mut peer_pending_events = Vec::new();
-                                       mem::swap(&mut peer_pending_events, &mut peer_state.pending_msg_events);
-                                       pending_events.append(&mut peer_pending_events);
+                                       pending_events.append(&mut peer_state.pending_msg_events);
                                }
                        }