]> Sergey Matveev's repositories - public-inbox.git/blobdiff - lib/PublicInbox/View.pm
thread: pass array refs instead of entire arrays
[public-inbox.git] / lib / PublicInbox / View.pm
index a3b26814f6897db2268124f29365abae495433de..e90efda16783ec2241050eededef689ae55af2a5 100644 (file)
@@ -749,8 +749,8 @@ sub msg_timestamp {
 
 sub thread_results {
        my ($msgs) = @_;
-       require PublicInbox::Thread;
-       my $th = PublicInbox::Thread->new(@$msgs);
+       require PublicInbox::SearchThread;
+       my $th = PublicInbox::SearchThread->new($msgs);
        $th->thread;
        $th->order(*sort_ts);
        $th
@@ -856,10 +856,10 @@ sub skel_dump {
 }
 
 sub sort_ts {
-       sort {
+       sort {
                (eval { $a->topmost->message->header('X-PI-TS') } || 0) <=>
                (eval { $b->topmost->message->header('X-PI-TS') } || 0)
-       } @_;
+       } @{$_[0]} ];
 }
 
 sub _tryload_ghost ($$) {