From 123031737a09edb3297e0fc6ea9e566fc2fecdf5 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Fri, 14 Oct 2016 09:00:01 +0000 Subject: thread: reinstates stable ordering when ghosts are present This reverts commit 3c9dd6619f825f0515e7e4afa1bd55c99c1a68d3 ("thread: fix sorting without topmost") and reinstates the "topmost" routine for sorting purposes. --- lib/PublicInbox/SearchView.pm | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'lib/PublicInbox/SearchView.pm') diff --git a/lib/PublicInbox/SearchView.pm b/lib/PublicInbox/SearchView.pm index cfe6dfff..ebeb41f7 100644 --- a/lib/PublicInbox/SearchView.pm +++ b/lib/PublicInbox/SearchView.pm @@ -155,8 +155,9 @@ sub mset_thread { $th->thread; if ($q->{r}) { # order by relevance $th->order(sub { - [ sort { ( $pct{$b->{id}} || 0) <=> - ( $pct{$a->{id}} || 0) + [ sort { (eval { $pct{$b->topmost->{id}} } || 0) + <=> + (eval { $pct{$a->topmost->{id}} } || 0) } @{$_[0]} ]; }); } else { # order by time (default for threaded view) -- cgit v1.2.3-24-ge0c7