]> Sergey Matveev's repositories - public-inbox.git/blobdiff - lib/PublicInbox/WwwListing.pm
www_listing: avoid unnecessary work for common cases
[public-inbox.git] / lib / PublicInbox / WwwListing.pm
index 0ab414522575483e0731ca7fc33657afbfe8f706..35abf05030d8f05d8d40ea6845536d0e59c3046a 100644 (file)
@@ -169,17 +169,15 @@ sub mset_nav_top {
        my ($ctx, $mset) = @_;
        my $q = $ctx->{-sq};
        my $qh = $q->{'q'} // '';
-       utf8::decode($qh);
-       $qh = ascii_html($qh);
-       $qh = qq[\nvalue="$qh"] if $qh ne '';
-       my $rv = <<EOM;
-<form
-action="./"><pre><input name=q type=text$qh
-/><input type=submit value="locate inbox"
-/><input type=submit name=a value="search all inboxes"
-/></pre></form><pre>
+       if ($qh ne '') {
+               utf8::decode($qh);
+               $qh = qq[\nvalue="].ascii_html($qh).'"';
+       }
+       chop(my $rv = <<EOM);
+<form action="./"><pre><input name=q type=text$qh/><input
+type=submit value="locate inbox"/><input type=submit name=a
+value="search all inboxes"/></pre></form><pre>
 EOM
-       chomp $rv;
        if (defined($q->{'q'})) {
                my $initial_q = $ctx->{-uxs_retried};
                if (defined $initial_q) {