about summary refs log tree commit homepage
path: root/lib/PublicInbox/View.pm
diff options
context:
space:
mode:
authorEric Wong (Contractor, The Linux Foundation) <e@80x24.org>2018-03-30 01:20:46 +0000
committerEric Wong (Contractor, The Linux Foundation) <e@80x24.org>2018-03-30 01:21:12 +0000
commitf886760b1b5c79181143743814a576a8fa5cf4d9 (patch)
tree3e2c9a049d1b944a34a71e01f512155fad137df3 /lib/PublicInbox/View.pm
parentdfef0d2c34fbf21d665c40b5ad5069e9113c35c8 (diff)
downloadpublic-inbox-f886760b1b5c79181143743814a576a8fa5cf4d9.tar.gz
It's no longer necessary to have this since load_expand
now populates $smsg->mid with the "preferred" Message-ID.
This saves around 10ms on the homepage for me.
Diffstat (limited to 'lib/PublicInbox/View.pm')
-rw-r--r--lib/PublicInbox/View.pm14
1 files changed, 4 insertions, 10 deletions
diff --git a/lib/PublicInbox/View.pm b/lib/PublicInbox/View.pm
index 60fc1df1..c151f221 100644
--- a/lib/PublicInbox/View.pm
+++ b/lib/PublicInbox/View.pm
@@ -409,7 +409,7 @@ sub thread_html {
         my $mid = $ctx->{mid};
         my $srch = $ctx->{srch};
         my $sres = $srch->get_thread($mid);
-        my $msgs = load_results($srch, $sres);
+        my $msgs = $sres->{msgs};
         my $nr = $sres->{total};
         return missing_thread($ctx) if $nr == 0;
         my $skel = '<hr><pre>';
@@ -680,7 +680,7 @@ sub thread_skel {
         $ctx->{prev_attr} = '';
         $ctx->{prev_level} = 0;
         $ctx->{dst} = $dst;
-        $sres = load_results($srch, $sres);
+        $sres = $sres->{msgs};
 
         # reduce hash lookups in skel_dump
         my $ibx = $ctx->{-inbox};
@@ -801,12 +801,6 @@ sub indent_for {
         $level ? INDENT x ($level - 1) : '';
 }
 
-sub load_results {
-        my ($srch, $sres) = @_;
-        my $msgs = delete $sres->{msgs};
-        $srch->retry_reopen(sub { [ map { $_->mid; $_ } @$msgs ] });
-}
-
 sub thread_results {
         my ($ctx, $msgs) = @_;
         require PublicInbox::SearchThread;
@@ -1088,9 +1082,9 @@ sub index_topics {
         }
 
         my $sres = $srch->query($qs, $opts);
-        my $nr = scalar @{$sres->{msgs}};
+        $sres = $sres->{msgs};
+        my $nr = scalar @$sres;
         if ($nr) {
-                $sres = load_results($srch, $sres);
                 walk_thread(thread_results($ctx, $sres), $ctx, *acc_topic);
         }
         $ctx->{-next_o} = $off + $nr;