also sort results for empty patterns

there are no scores in this case, but it still makes tiebreak handling
more consistent
This commit is contained in:
Jesse Luehrs
2025-01-26 15:41:57 -05:00
committed by Pascal Kuthe
parent d0d6b3a584
commit 61f2a4e482

View File

@@ -166,7 +166,10 @@ impl<T: Sync + Send + 'static> Worker<T> {
if self.pattern.is_empty() {
self.reset_matches();
self.process_new_items_trivial();
if self.should_notify.load(atomic::Ordering::Relaxed) {
let canceled = self.sort_matches();
if canceled {
self.was_canceled = true;
} else if self.should_notify.load(atomic::Ordering::Relaxed) {
(self.notify)();
}
return;