From: Eric Wong Date: Thu, 14 Jan 2021 07:06:26 +0000 (-1200) Subject: lei: remove temporary var on open X-Git-Tag: v1.7.0~1364 X-Git-Url: http://www.git.stargrave.org/?a=commitdiff_plain;h=9ecd339fc32ff9c6b8ddcc98a992f5bcc682077e;p=public-inbox.git lei: remove temporary var on open We can place the IO/GLOB ref directly into $self, here. --- 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);