about summary refs log tree commit homepage
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2023-10-04 03:49:18 +0000
committerEric Wong <e@80x24.org>2023-10-04 17:46:34 +0000
commit830ff2d76f38fed230eaa8fb8fc5a5e83917562a (patch)
tree6686e96dd48e5a27651064fd47b690f016d626b8
parent398392e62ae4790f28b74ff92494a906061c837f (diff)
downloadpublic-inbox-830ff2d76f38fed230eaa8fb8fc5a5e83917562a.tar.gz
So save us a few ugly defined-ness checks.
-rw-r--r--lib/PublicInbox/InputPipe.pm11
1 files changed, 5 insertions, 6 deletions
diff --git a/lib/PublicInbox/InputPipe.pm b/lib/PublicInbox/InputPipe.pm
index e1e26e20..60a9f01f 100644
--- a/lib/PublicInbox/InputPipe.pm
+++ b/lib/PublicInbox/InputPipe.pm
@@ -1,10 +1,9 @@
-# Copyright (C) 2021 all contributors <meta@public-inbox.org>
+# Copyright (C) all contributors <meta@public-inbox.org>
 # License: AGPL-3.0+ <https://www.gnu.org/licenses/agpl-3.0.txt>
 
 # for reading pipes and sockets off the DS event loop
 package PublicInbox::InputPipe;
-use strict;
-use v5.10.1;
+use v5.12;
 use parent qw(PublicInbox::DS);
 use PublicInbox::Syscall qw(EPOLLIN EPOLLET);
 
@@ -20,15 +19,15 @@ sub event_step {
         my ($self) = @_;
         my $r = sysread($self->{sock} // return, my $rbuf, 65536);
         if ($r) {
-                $self->{cb}->(@{$self->{args} // []}, $rbuf);
+                $self->{cb}->(@{$self->{args}}, $rbuf);
                 return $self->requeue; # may be regular file or pipe
         }
         if (defined($r)) { # EOF
-                $self->{cb}->(@{$self->{args} // []}, '');
+                $self->{cb}->(@{$self->{args}}, '');
         } elsif ($!{EAGAIN}) {
                 return;
         } else { # another error
-                $self->{cb}->(@{$self->{args} // []}, undef)
+                $self->{cb}->(@{$self->{args}}, undef)
         }
         $self->{sock}->blocking ? delete($self->{sock}) : $self->close
 }