[Bast-commits] r6153 -
DBIx-Class/0.08/branches/count_distinct/lib/DBIx/Class/Storage
ribasushi at dev.catalyst.perl.org
ribasushi at dev.catalyst.perl.org
Wed May 6 22:56:40 GMT 2009
Author: ribasushi
Date: 2009-05-06 22:56:40 +0000 (Wed, 06 May 2009)
New Revision: 6153
Modified:
DBIx-Class/0.08/branches/count_distinct/lib/DBIx/Class/Storage/DBI.pm
Log:
Rename internal function to clarify what it does
Modified: DBIx-Class/0.08/branches/count_distinct/lib/DBIx/Class/Storage/DBI.pm
===================================================================
--- DBIx-Class/0.08/branches/count_distinct/lib/DBIx/Class/Storage/DBI.pm 2009-05-06 19:12:19 UTC (rev 6152)
+++ DBIx-Class/0.08/branches/count_distinct/lib/DBIx/Class/Storage/DBI.pm 2009-05-06 22:56:40 UTC (rev 6153)
@@ -175,7 +175,7 @@
}
# Is the second check absolutely necessary?
elsif ( $ref eq 'REF' and ref($$fields) eq 'ARRAY' ) {
- return $self->_bind_to_sql( $fields );
+ return $self->_fold_sqlbind( $fields );
}
else {
Carp::croak($ref . qq{ unexpected in _recurse_fields()})
@@ -268,18 +268,18 @@
return join('', @sqlf);
}
-sub _bind_to_sql {
- my ($self, $arr) = @_;
- my ($sql, @bind) = @{${$arr}};
- push (@{$self->{from_bind}}, @bind);
+sub _fold_sqlbind {
+ my ($self, $sqlbind) = @_;
+ my $sql = shift @$$sqlbind;
+ push @{$self->{from_bind}}, @$$sqlbind;
return $sql;
}
sub _make_as {
my ($self, $from) = @_;
- return join(' ', map { (ref $_ eq 'SCALAR' ? $$_
- : ref $_ eq 'REF' ? $self->_bind_to_sql($_)
- : $self->_quote($_))
+ return join(' ', map { (ref $_ eq 'SCALAR' ? $$_
+ : ref $_ eq 'REF' ? $self->_fold_sqlbind($_)
+ : $self->_quote($_))
} reverse each %{$self->_skip_options($from)});
}
More information about the Bast-commits
mailing list