unofficial mirror of meta@public-inbox.org
 help / color / mirror / Atom feed
From: Eric Wong <e@80x24.org>
To: meta@public-inbox.org
Subject: [PATCH 1/3] viewvcs: avoid one ascii_html call
Date: Mon, 10 Oct 2022 21:34:20 +0000	[thread overview]
Message-ID: <20221010213422.23048-2-e@80x24.org> (raw)
In-Reply-To: <20221010213422.23048-1-e@80x24.org>

We can reuse its result for the button text.
---
 lib/PublicInbox/ViewVCS.pm | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/lib/PublicInbox/ViewVCS.pm b/lib/PublicInbox/ViewVCS.pm
index 72b79ab7..86bae7d6 100644
--- a/lib/PublicInbox/ViewVCS.pm
+++ b/lib/PublicInbox/ViewVCS.pm
@@ -247,9 +247,14 @@ EOM
 			my $rows = ($q =~ tr/\n/\n/) + 1;
 			$q = ascii_html($q);
 			my $ibx_url = ibx_url_for($ctx);
-			my $alt = $ibx_url ? ' '.ascii_html($ibx_url) : '';
-			$ibx_url = ascii_html($ibx_url) if defined $ibx_url;
-			$ibx_url //= $upfx;
+			my $alt;
+			if (defined $ibx_url) {
+				$ibx_url = ascii_html($ibx_url);
+				$alt = ' '.$ibx_url;
+			} else {
+				$ibx_url = $upfx;
+				$alt = '';
+			}
 			print $zfh <<EOM;
 <hr><form action="$ibx_url"
 id=related><pre>find related emails, including ancestors/descendants/conflicts

  reply	other threads:[~2022-10-10 21:34 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-10 21:34 [PATCH 0/3] www: viewvcs: tags + minor updates Eric Wong
2022-10-10 21:34 ` Eric Wong [this message]
2022-10-10 21:34 ` [PATCH 2/3] xt/solver: skip on missing publicinbox.git.coderepo Eric Wong
2022-10-10 21:34 ` [PATCH 3/3] www: viewvcs: display annotated tags as discreet objects Eric Wong

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://public-inbox.org/README

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20221010213422.23048-2-e@80x24.org \
    --to=e@80x24.org \
    --cc=meta@public-inbox.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).