]> Sergey Matveev's repositories - public-inbox.git/commitdiff
nntp: use defined-OR from Perl 5.10 for msgid check
authorEric Wong <e@80x24.org>
Tue, 12 Oct 2021 11:47:00 +0000 (11:47 +0000)
committerEric Wong <e@80x24.org>
Tue, 12 Oct 2021 21:46:33 +0000 (21:46 +0000)
"<0>" could be a valid Message-ID, maybe...

lib/PublicInbox/NNTP.pm

index ea9ce18358f984e546d86b501defde569d8ac4ec..aa0193687dd6bc6cde4e2b9e620a4cd97699c048 100644 (file)
@@ -9,6 +9,7 @@
 # long_cb: long_response private data
 package PublicInbox::NNTP;
 use strict;
+use v5.10.1;
 use parent qw(PublicInbox::DS);
 use PublicInbox::MID qw(mid_escape $MID_EXTRACT);
 use PublicInbox::Eml;
@@ -381,11 +382,10 @@ sub article_adj ($$) {
        defined $n or return '420 no current article has been selected';
 
        $n += $off;
-       my $mid = $ibx->mm(1)->mid_for($n);
-       unless ($mid) {
+       my $mid = $ibx->mm(1)->mid_for($n) // do {
                $n = $off > 0 ? 'next' : 'previous';
                return "421 no $n article in this group";
-       }
+       };
        $self->{article} = $n;
        "223 $n <$mid> article retrieved - request text separately";
 }