about summary refs log tree commit homepage
path: root/lib/PublicInbox/SearchView.pm
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2016-06-30 02:35:17 +0000
committerEric Wong <e@80x24.org>2016-06-30 07:24:47 +0000
commit0c28e937c80f3134898bc41f10bc9de350851944 (patch)
tree2e001850bb9aca0e9abbb29c050a00f8be45b63a /lib/PublicInbox/SearchView.pm
parent1e0b530449910eb35561e068de7e4084175b78e6 (diff)
downloadpublic-inbox-0c28e937c80f3134898bc41f10bc9de350851944.tar.gz
This reduces the level of indirection to reach certain objects
within the hash and there are no namespace or lifetime conflicts
anyways.
Diffstat (limited to 'lib/PublicInbox/SearchView.pm')
-rw-r--r--lib/PublicInbox/SearchView.pm25
1 files changed, 10 insertions, 15 deletions
diff --git a/lib/PublicInbox/SearchView.pm b/lib/PublicInbox/SearchView.pm
index 8771d5d3..4af6cadb 100644
--- a/lib/PublicInbox/SearchView.pm
+++ b/lib/PublicInbox/SearchView.pm
@@ -170,21 +170,16 @@ sub mset_thread {
         my $skel = search_nav_bot($mset, $q). "<pre>";
         my $inbox = $ctx->{-inbox};
         $ctx->{-upfx} = '';
-        my $state = {
-                -inbox => $inbox,
-                anchor_idx => 1,
-                ctx => $ctx,
-                cur_level => 0,
-                dst => \$skel,
-                mapping => {},
-                pct => \%pct,
-                prev_attr => '',
-                prev_level => 0,
-                seen => {},
-                srch => $ctx->{srch},
-        };
+        $ctx->{anchor_idx} = 1;
+        $ctx->{cur_level} = 0;
+        $ctx->{dst} = \$skel;
+        $ctx->{mapping} = {};
+        $ctx->{pct} = \%pct;
+        $ctx->{prev_attr} = '';
+        $ctx->{prev_level} = 0;
+        $ctx->{seen} = {};
 
-        PublicInbox::View::walk_thread($th, $state,
+        PublicInbox::View::walk_thread($th, $ctx,
                 *PublicInbox::View::pre_thread);
 
         my $msgs = \@m;
@@ -197,7 +192,7 @@ sub mset_thread {
                 }
                 if ($mime) {
                         $mime = Email::MIME->new($mime);
-                        return PublicInbox::View::index_entry($mime, $state);
+                        return PublicInbox::View::index_entry($mime, $ctx);
                 }
                 $msgs = undef;
                 $skel .= "\n</pre>";