From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-4.2 required=3.0 tests=ALL_TRUSTED,AWL,BAYES_00, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF shortcircuit=no autolearn=ham autolearn_force=no version=3.4.6 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id 5580A1F569 for ; Wed, 4 Oct 2023 03:49:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=80x24.org; s=selector1; t=1696391374; bh=MVMIsdu/RNI+V0lR11K0wk6FsETD9RLjqh9aAMGejT0=; h=From:To:Subject:Date:In-Reply-To:References:From; b=rDbxo927Tp3RQTet3aJ0mhECociwnVvyQdc20GhOFMXJ9MPlYVUmYCALeZezR5IM3 Insy7UmwwqLJqvtrSfzgsoRKEBGAyoRzwbeqpPALqGeq2xMYPz9xW3tf406ZXc2cBp 9UtqT01R8JMu4mXRwdnfzTXDClkJw27CHk3/GmP8= From: Eric Wong To: meta@public-inbox.org Subject: [PATCH 06/21] input_pipe: {args} is never undefined Date: Wed, 4 Oct 2023 03:49:18 +0000 Message-ID: <20231004034933.3343930-7-e@80x24.org> In-Reply-To: <20231004034933.3343930-1-e@80x24.org> References: <20231004034933.3343930-1-e@80x24.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: So save us a few ugly defined-ness checks. --- lib/PublicInbox/InputPipe.pm | 11 +++++------ 1 file 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 +# 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 }