From: Matt S Trout Date: Wed, 27 Mar 2019 04:22:11 +0000 (+0000) Subject: make , special cased to avoid premature generalisation X-Git-Tag: v2.000000~3^2~307 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=9e615f781d9d1c9b1bae6cb54112daa24194dec9;p=dbsrgits%2FSQL-Abstract.git make , special cased to avoid premature generalisation --- diff --git a/lib/SQL/Abstract.pm b/lib/SQL/Abstract.pm index bea7b45..0f10a77 100644 --- a/lib/SQL/Abstract.pm +++ b/lib/SQL/Abstract.pm @@ -248,7 +248,7 @@ sub new { ), (not => '_render_op_not'), (map +($_ => '_render_op_andor'), qw(and or)), - ',' => sub { shift->_render_op_multop(@_, 1) }, + ',' => '_render_op_multop', }; return bless \%opt, $class; @@ -1191,12 +1191,12 @@ sub _render_op_andor { } sub _render_op_multop { - my ($self, $op, $args, $strip_left) = @_; + my ($self, $op, $args) = @_; my @parts = grep length($_->[0]), map [ $self->render_aqt($_) ], @$args; return '' unless @parts; return @{$parts[0]} if @parts == 1; my ($final_sql) = join( - ($strip_left ? '' : ' ').$self->_sqlcase(join ' ', split '_', $op).' ', + ($op eq ',' ? '' : ' ').$self->_sqlcase(join ' ', split '_', $op).' ', map $_->[0], @parts ); return (