From: Eric Wong Date: Wed, 4 Oct 2023 03:49:18 +0000 (+0000) Subject: input_pipe: {args} is never undefined X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=830ff2d76f38fed230eaa8fb8fc5a5e83917562a;p=thirdparty%2Fpublic-inbox.git input_pipe: {args} is never undefined So save us a few ugly defined-ness checks. --- diff --git a/lib/PublicInbox/InputPipe.pm b/lib/PublicInbox/InputPipe.pm index e1e26e20b..60a9f01f8 100644 --- a/lib/PublicInbox/InputPipe.pm +++ b/lib/PublicInbox/InputPipe.pm @@ -1,10 +1,9 @@ -# Copyright (C) 2021 all contributors +# Copyright (C) all contributors # License: AGPL-3.0+ # 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 }