unop expander wrapper conversion
[scpubgit/Q-Branch.git] / lib / SQL / Abstract / ExtraClauses.pm
index 22817ce..7a70118 100644 (file)
@@ -61,7 +61,7 @@ sub apply_to {
   });
 
   $sqla->clause_expanders(
-    'update.from' => $self->cb('_expand_select_clause_from'),
+    'update.from' => $self->cb('_expand_from_list'),
     'delete.using' => $self->cb('_expand_from_list'),
     'insert.rowvalues' => $self->cb(sub {
       +(from => $_[0]->expand_expr({ -values => $_[2] }));
@@ -76,10 +76,9 @@ sub apply_to {
     $self->cb('_expand_select', $_[0], \@before_setop);
   });
 
-  $sqla->clause_renderer('select.setop' => $self->cb(sub {
-    my ($self, undef, $setop) = @_;
-    $self->render_aqt($setop);
-  }));
+  $sqla->clause_renderer(
+    'select.setop' => $self->cb(sub { $_[0]->render_aqt($_[2]); })
+  );
 
   foreach my $setop (qw(union intersect except)) {
     $sqla->expander($setop => $self->cb('_expand_setop'));
@@ -111,7 +110,7 @@ sub apply_to {
   $sqla->expander(cast => $self->cb('_expand_cast'));
 
   $sqla->clause_expanders(
-    "select.from", $self->cb('_expand_select_clause_from'),
+    "select.from", $self->cb('_expand_from_list'),
     "update.target", $self->cb('_expand_update_clause_target'),
     "update.update", $self->cb('_expand_update_clause_target'),
   );
@@ -131,11 +130,6 @@ sub _expand_select {
   return $exp;
 }
 
-sub _expand_select_clause_from {
-  my ($self, undef, $from) = @_;
-  +(from => $self->_expand_from_list(undef, $from));
-}
-
 sub _expand_from_list {
   my ($self, undef, $args) = @_;
   if (ref($args) eq 'HASH') {