From 28ee19c32a1ecf8e22f30e8f9de860695f4fb30c Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Sat, 29 Aug 2015 21:30:27 +0000 Subject: avoid length in boolean context Perl does not currently optimize for this. ref (from p5p): http://mid.gmane.org/D5C27970-9176-4C7A-8B99-7D78360E67A2@pobox.com --- lib/PublicInbox/WWW.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/PublicInbox/WWW.pm') diff --git a/lib/PublicInbox/WWW.pm b/lib/PublicInbox/WWW.pm index 8058f3e1..a01271b1 100644 --- a/lib/PublicInbox/WWW.pm +++ b/lib/PublicInbox/WWW.pm @@ -249,7 +249,7 @@ sub do_redirect { sub ctx_get { my ($ctx, $key) = @_; my $val = $ctx->{$key}; - (defined $val && length $val) or die "BUG: bad ctx, $key unusable\n"; + (defined $val && $val ne '') or die "BUG: bad ctx, $key unusable\n"; $val; } -- cgit v1.2.3-24-ge0c7