Use hash slice assignment instead of loop
Dagfinn Ilmari Mannsåker [Fri, 20 Dec 2013 19:28:33 +0000 (19:28 +0000)]
lib/DBIx/Class/Schema/Loader/RelBuilder.pm

index c463b77..50452b9 100644 (file)
@@ -409,9 +409,7 @@ sub generate_code {
             }
 
             my %cond;
-            foreach my $i (0 .. $#$local_cols) {
-                $cond{$remote_cols->[$i]} = $local_cols->[$i];
-            }
+            @cond{@$remote_cols} = @$local_cols;
 
             my ( $local_relname, $remote_relname, $remote_method ) =
                 $self->_relnames_and_method( $local_moniker, $rel, \%cond,  $uniqs, \%counters );