use hashtriple for auto-expand generation
Matt S Trout [Tue, 26 Mar 2019 03:40:53 +0000 (03:40 +0000)]
lib/SQL/Abstract.pm

index b4fcecb..3127250 100644 (file)
@@ -212,11 +212,9 @@ sub new {
       my ($op) = $name =~ /^-(.*)$/;
       $opt{expand_op}{$op} = sub {
         my ($self, $op, $arg, $k) = @_;
-        return +{ -op => [
-          $self->{cmp},
-          $self->_expand_ident(-ident => $k),
-          $self->_expand_expr({ '-'.$op => $arg }),
-        ] };
+        return $self->_expand_expr_hashtriple(
+          $k, $self->{cmp}, { "-${op}" => $arg }
+        );
       };
     }
   }