]> Sergey Matveev's repositories - public-inbox.git/commitdiff
lei: remove temporary var on open
authorEric Wong <e@80x24.org>
Thu, 14 Jan 2021 07:06:26 +0000 (19:06 -1200)
committerEric Wong <e@80x24.org>
Fri, 15 Jan 2021 00:19:12 +0000 (00:19 +0000)
We can place the IO/GLOB ref directly into $self, here.

lib/PublicInbox/LEI.pm

index a8fea16d3aa47077b3f761a37705acf081582c81..9786e7ac27effa3c0fbe2bac2e5efe9a33a7dc88 100644 (file)
@@ -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);