Thread (9 messages) flat view 9 messages, 3 authors, 2016-06-15

Re: [PATCHv4 4/6] Git.pm: allow pipes to be closed prior to calling command_close_bidi_pipe

From: Michal Nazarewicz <hidden>
Date: 2016-06-15 22:56:09

On Tue, Feb 12 2013, Jeff King wrote:
On Tue, Feb 12, 2013 at 03:02:31PM +0100, Michal Nazarewicz wrote:
quoted
 sub command_close_bidi_pipe {
 	local $?;
 	my ($self, $pid, $in, $out, $ctx) = _maybe_self(@_);
-	_cmd_close($ctx, $in, $out);
+	_cmd_close($ctx, grep defined, $in, $out);
Maybe it is just me, but I find the "grep EXPR" form a little subtle
inside an argument list. Either:

  _cmd_close($ctx, grep { defined } $in, $out);

or

  _cmd_close($ctx, grep(defined, $in, $out));

is a little more obvious to me.
I personally avoid parens whenever possible in Perl, but Git.pm seem to
favour them so I went with the second option.

-- 
Best regards,                                         _     _
.o. | Liege of Serenely Enlightened Majesty of      o' \,=./ `o
..o | Computer Science,  Michał “mina86” Nazarewicz    (o o)
ooo +----<email/xmpp: mpn@google.com>--------------ooO--(_)--Ooo--
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help