about summary refs log tree commit homepage
path: root/lib/PublicInbox/SearchView.pm
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2016-10-05 23:47:18 +0000
committerEric Wong <e@80x24.org>2016-10-05 23:52:27 +0000
commitc5b3d2549596b773d52e5feb947f461630dfe301 (patch)
tree1e0e16f857a6736d9d9224c7ac121c59f6e062f3 /lib/PublicInbox/SearchView.pm
parent172416d1cd465da4242cc744a3f309d307f1311d (diff)
downloadpublic-inbox-c5b3d2549596b773d52e5feb947f461630dfe301.tar.gz
Copying large arrays is expensive, so avoid it.
This reduces /$INBOX/ time by around 1%.
Diffstat (limited to 'lib/PublicInbox/SearchView.pm')
-rw-r--r--lib/PublicInbox/SearchView.pm4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/PublicInbox/SearchView.pm b/lib/PublicInbox/SearchView.pm
index da311093..0d54c3df 100644
--- a/lib/PublicInbox/SearchView.pm
+++ b/lib/PublicInbox/SearchView.pm
@@ -156,10 +156,10 @@ sub mset_thread {
         $th->thread;
         if ($q->{r}) { # order by relevance
                 $th->order(sub {
-                        sort { (eval { $pct{$b->topmost->messageid} } || 0)
+                        [ sort { (eval { $pct{$b->topmost->messageid} } || 0)
                                         <=>
                                 (eval { $pct{$a->topmost->messageid} } || 0)
-                        } @_;
+                        } @{$_[0]} ];
                 });
         } else { # order by time (default for threaded view)
                 $th->order(*PublicInbox::View::sort_ts);