From: Matt S Trout Date: Tue, 26 Mar 2019 01:57:59 +0000 (+0000) Subject: move rendering to default render_op X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=9159df954b6ebb90be5bcb6585ffd954f97e5943;p=scpubgit%2FQ-Branch.git move rendering to default render_op --- diff --git a/lib/SQL/Abstract.pm b/lib/SQL/Abstract.pm index 392bcd8..41a26f0 100644 --- a/lib/SQL/Abstract.pm +++ b/lib/SQL/Abstract.pm @@ -226,7 +226,15 @@ sub new { %{$opt{render}||{}} }; - $opt{render_op} = our $RENDER_OP; + $opt{render_op} = { + (map +($_ => '_render_op_between'), 'between', 'not between'), + (map +($_ => '_render_op_in'), 'in', 'not in'), + (map +($_ => '_render_unop_postfix'), + 'is null', 'is not null', 'asc', 'desc', + ), + (not => '_render_op_not'), + (map +($_ => '_render_op_andor'), qw(and or)), + }; return bless \%opt, $class; } @@ -1079,16 +1087,6 @@ sub _render_op_andor { ); } -our $RENDER_OP = { - (map +($_ => '_render_op_between'), 'between', 'not between'), - (map +($_ => '_render_op_in'), 'in', 'not in'), - (map +($_ => '_render_unop_postfix'), - 'is null', 'is not null', 'asc', 'desc', - ), - (not => '_render_op_not'), - (map +($_ => '_render_op_andor'), qw(and or)), -}; - sub _render_op { my ($self, $v) = @_; my ($op, @args) = @$v;