From: Matt S Trout Date: Tue, 26 Mar 2019 03:43:43 +0000 (+0000) Subject: extract _hashpair_cmp for using default cmp X-Git-Tag: v1.90_01~306 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=efcd97c325c5c33243aaa0aeb080ee2f59f13693;p=dbsrgits%2FSQL-Abstract.git extract _hashpair_cmp for using default cmp --- diff --git a/lib/SQL/Abstract.pm b/lib/SQL/Abstract.pm index 3127250..4a1be88 100644 --- a/lib/SQL/Abstract.pm +++ b/lib/SQL/Abstract.pm @@ -212,8 +212,8 @@ sub new { my ($op) = $name =~ /^-(.*)$/; $opt{expand_op}{$op} = sub { my ($self, $op, $arg, $k) = @_; - return $self->_expand_expr_hashtriple( - $k, $self->{cmp}, { "-${op}" => $arg } + return $self->_expand_expr_hashpair_cmp( + $k, { "-${op}" => $arg } ); }; } @@ -636,7 +636,7 @@ sub _expand_expr_hashpair_ident { and not defined $v->{-value} ) ) { - return $self->_expand_expr_hashtriple($k => $self->{cmp} => undef); + return $self->_expand_expr_hashpair_cmp($k => undef); } # scalars and objects get expanded as whatever requested or values @@ -744,6 +744,11 @@ sub _expand_expr_hashpair_op { die "notreached"; } +sub _expand_expr_hashpair_cmp { + my ($self, $k, $v) = @_; + $self->_expand_expr_hashtriple($k, $self->{cmp}, $v); +} + sub _expand_expr_hashtriple { my ($self, $k, $vk, $vv) = @_;