From 7da4c6cea398bda29dd33dc41a28c634c73d72a5 Mon Sep 17 00:00:00 2001 From: Erica Z Date: Sun, 3 Nov 2024 19:08:58 +0100 Subject: [PATCH] uh huh --- src/signal.rs | 19 ++++--------------- src/ui/play_queue/song.rs | 6 ------ 2 files changed, 4 insertions(+), 21 deletions(-) diff --git a/src/signal.rs b/src/signal.rs index 6dfb290..c1be112 100644 --- a/src/signal.rs +++ b/src/signal.rs @@ -101,27 +101,16 @@ impl SignalEmitter { .expect("tried to re-emit signal during emission"); handlers.append(self.just_connected.borrow_mut().as_mut()); - if handlers.is_empty() { - return; - } - let mut i = 0; let mut skip = 0; - loop { - if handlers[i + skip](emitter, f()) { + // FIXME: does not preserve ordering + while i < handlers.len() { + if handlers[i](emitter, f()) { i += 1; } else { - skip += 1; + drop(handlers.swap_remove(i)); } - - if i + skip == handlers.len() { - break; - } - - handlers.swap(i, i + skip); } - - handlers.truncate(i); } } diff --git a/src/ui/play_queue/song.rs b/src/ui/play_queue/song.rs index 96cd66c..4eb5676 100644 --- a/src/ui/play_queue/song.rs +++ b/src/ui/play_queue/song.rs @@ -165,12 +165,6 @@ mod imp { false } } - - impl Drop for Song { - fn drop(&mut self) { - println!("dropping AudreyUiPlayQueueSong"); - } - } } use crate::playbin::Song as PlaybinSong;