From: Daniel Westermann-Clark Date: Tue, 18 Apr 2006 07:46:55 +0000 (-0400) Subject: No need to loop again X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=c3a7fa1a644edc01ce5d88088b2bcaaf477dd2b7;p=dbsrgits%2FDBIx-Class-Historic.git No need to loop again --- diff --git a/lib/DBIx/Class/ResultSet.pm b/lib/DBIx/Class/ResultSet.pm index 584ec96..51541da 100644 --- a/lib/DBIx/Class/ResultSet.pm +++ b/lib/DBIx/Class/ResultSet.pm @@ -337,16 +337,12 @@ sub find { my @unique_cols = $self->result_source->unique_constraint_columns($name); my %unique_hash = $self->_unique_hash(\%hash, \@unique_cols); - # TODO: Check that the ResultSet defines the rest of the query - push @unique_hashes, \%unique_hash - if scalar keys %unique_hash;# == scalar @unique_cols; - } - - # Add the ResultSet's alias - foreach my $unique_hash (@unique_hashes) { - foreach my $key (grep { ! m/\./ } keys %$unique_hash) { - $unique_hash->{"$self->{attrs}{alias}.$key"} = delete $unique_hash->{$key}; + # Add the ResultSet's alias + foreach my $key (grep { ! m/\./ } keys %unique_hash) { + $unique_hash{"$self->{attrs}{alias}.$key"} = delete $unique_hash{$key}; } + + push @unique_hashes, \%unique_hash if %unique_hash; } # Handle cases where the ResultSet already defines the query