From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-Status: No, score=-4.0 required=3.0 tests=ALL_TRUSTED,BAYES_00 shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id 106401FF9D for ; Thu, 14 Jan 2021 07:06:29 +0000 (UTC) From: Eric Wong To: meta@public-inbox.org Subject: [PATCH 13/14] lei: remove temporary var on open Date: Wed, 13 Jan 2021 19:06:26 -1200 Message-Id: <20210114070627.18195-14-e@80x24.org> In-Reply-To: <20210114070627.18195-1-e@80x24.org> References: <20210114070627.18195-1-e@80x24.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: We can place the IO/GLOB ref directly into $self, here. --- lib/PublicInbox/LEI.pm | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/lib/PublicInbox/LEI.pm b/lib/PublicInbox/LEI.pm index a8fea16d..9786e7ac 100644 --- a/lib/PublicInbox/LEI.pm +++ b/lib/PublicInbox/LEI.pm @@ -678,11 +678,8 @@ sub accept_dispatch { # Listener {post_accept} callback my $i = 0; for my $rdr (qw(<&= >&= >&=)) { my $fd = shift(@fds); - if (open(my $fh, $rdr, $fd)) { - $self->{$i++} = $fh; - next; - } - return send($sock, "open($rdr$fd) (FD=$i): $!", MSG_EOR); + open($self->{$i++}, $rdr, $fd) and next; + send($sock, "open($rdr$fd) (FD=$i): $!", MSG_EOR); } } else { return send($sock, "recv_cmd failed: $!", MSG_EOR);