From 9ecd339fc32ff9c6b8ddcc98a992f5bcc682077e Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Wed, 13 Jan 2021 19:06:26 -1200 Subject: lei: remove temporary var on open 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); -- cgit v1.2.3-24-ge0c7