about summary refs log tree commit homepage
path: root/lib/PublicInbox/SearchView.pm
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2018-04-01 22:58:19 +0000
committerEric Wong <e@80x24.org>2018-04-01 23:04:20 +0000
commit3f3d9cf7d88a851721f1f8468e1311a4f0c02ff6 (patch)
treecd42360b41e5e695c5f19802ec0147149b4e6e6d /lib/PublicInbox/SearchView.pm
parent051a182852a9eef8b0dc8714c81293daded1d4dc (diff)
downloadpublic-inbox-3f3d9cf7d88a851721f1f8468e1311a4f0c02ff6.tar.gz
We don't want non-fully-numeric limits being compared and
tripping warnings.  While we're at it, avoid hard-coding
'200' and reuse $LIM as the default.
Diffstat (limited to 'lib/PublicInbox/SearchView.pm')
-rw-r--r--lib/PublicInbox/SearchView.pm6
1 files changed, 2 insertions, 4 deletions
diff --git a/lib/PublicInbox/SearchView.pm b/lib/PublicInbox/SearchView.pm
index bf4415f0..219006a0 100644
--- a/lib/PublicInbox/SearchView.pm
+++ b/lib/PublicInbox/SearchView.pm
@@ -309,10 +309,8 @@ sub new {
         my ($class, $qp) = @_;
 
         my $r = $qp->{r};
-        my $l = $qp->{l} || '200';
-        if (! ($l =~ /(\d+)/ && $l <= $LIM)) {
-                $l = $LIM;
-        }
+        my ($l) = (($qp->{l} || '') =~ /(\d+)/);
+        $l = $LIM if !$l || $l > $LIM;
         bless {
                 q => $qp->{'q'},
                 x => $qp->{x} || '',