]> Sergey Matveev's repositories - public-inbox.git/blobdiff - lib/PublicInbox/SearchView.pm
treewide: run update-copyrights from gnulib for 2019
[public-inbox.git] / lib / PublicInbox / SearchView.pm
index 6587d37fb9f94011e955ada6cb6139172cddd398..828926c721790b2e9ad3176e6f7284c69eb2b873 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright (C) 2015-2019 all contributors <meta@public-inbox.org>
+# Copyright (C) 2015-2020 all contributors <meta@public-inbox.org>
 # License: AGPL-3.0+ <https://www.gnu.org/licenses/agpl-3.0.txt>
 #
 # Displays search results for the web interface
@@ -10,14 +10,11 @@ use PublicInbox::SearchMsg;
 use PublicInbox::Hval qw/ascii_html obfuscate_addrs/;
 use PublicInbox::View;
 use PublicInbox::WwwAtomStream;
-use PublicInbox::MID qw(MID_ESC);
-use PublicInbox::MIME;
-require PublicInbox::Git;
-require PublicInbox::SearchThread;
+use PublicInbox::SearchThread;
 our $LIM = 200;
 my %rmap_inc;
 
-sub noop {}
+my $noop = sub {};
 
 sub mbox_results {
        my ($ctx) = @_;
@@ -62,7 +59,7 @@ retry:
        if ($err) {
                $code = 400;
                $ctx->{-html_tip} = '<pre>'.err_txt($ctx, $err).'</pre><hr>';
-               $cb = *noop;
+               $cb = $noop;
        } elsif ($total == 0) {
                if (defined($ctx->{-uxs_retried})) {
                        # undo retry damage:
@@ -74,7 +71,7 @@ retry:
                }
                $code = 404;
                $ctx->{-html_tip} = "<pre>\n[No results found]</pre><hr>";
-               $cb = *noop;
+               $cb = $noop;
        } else {
                return adump($_[0], $mset, $q, $ctx) if $x eq 'A';
 
@@ -125,7 +122,7 @@ sub mset_summary {
                $$res .= "$pfx  - by $f @ $date UTC [$pct%]\n\n";
        }
        $$res .= search_nav_bot($mset, $q);
-       *noop;
+       $noop;
 }
 
 # shorten "/full/path/to/Foo/Bar.pm" to "Foo/Bar.pm" so error
@@ -280,7 +277,7 @@ sub mset_thread {
        $ctx->{-upfx} = '';
        $ctx->{anchor_idx} = 1;
        $ctx->{cur_level} = 0;
-       $ctx->{dst} = \$skel;
+       $ctx->{skel} = \$skel;
        $ctx->{mapping} = {};
        $ctx->{searchview} = 1;
        $ctx->{prev_attr} = '';
@@ -290,7 +287,7 @@ sub mset_thread {
        # reduce hash lookups in skel_dump
        $ctx->{-obfuscate} = $ctx->{-inbox}->{obfuscate};
        PublicInbox::View::walk_thread($rootset, $ctx,
-               *PublicInbox::View::pre_thread);
+               \&PublicInbox::View::pre_thread);
 
        @$msgs = reverse @$msgs if $r;
        $ctx->{msgs} = $msgs;
@@ -306,7 +303,7 @@ sub mset_thread_i {
                return PublicInbox::View::index_entry($smsg, $ctx,
                                                        scalar @$msgs);
        }
-       my ($skel) = delete @$ctx{qw(dst msgs)};
+       my ($skel) = delete @$ctx{qw(skel msgs)};
        $$skel .= "\n</pre>";
 }
 
@@ -350,7 +347,6 @@ package PublicInbox::SearchQuery;
 use strict;
 use warnings;
 use URI::Escape qw(uri_escape);
-use PublicInbox::Hval;
 use PublicInbox::MID qw(MID_ESC);
 
 sub new {