]> Dogcows Code - chaz/p5-DBIx-Class-ResultSet-RecursiveUpdate/commitdiff
small performance improvement
authorAlexander Hartmaier <abraxxa@cpan.org>
Sat, 23 Oct 2010 11:56:36 +0000 (13:56 +0200)
committerAlexander Hartmaier <abraxxa@cpan.org>
Sat, 23 Oct 2010 11:56:36 +0000 (13:56 +0200)
lib/DBIx/Class/ResultSet/RecursiveUpdate.pm

index 2d0c235ae5370a532b3add0ce8401ac6c0f70b39..c42f1b7cc6321aa195764c75bdc50da608dba68b 100644 (file)
@@ -47,7 +47,9 @@ sub recursive_update {
         };
     $resolved ||= {};
 
-    # warn 'entering: ' . $self->result_source->from();
+    my $source = $self->result_source;
+
+    # warn 'entering: ' . $source->from();
     carp 'fixed fields needs to be an array ref'
         if defined $fixed_fields && ref $fixed_fields ne 'ARRAY';
 
@@ -62,7 +64,7 @@ sub recursive_update {
         if $fixed_fields;
     my @missing =
         grep { !exists $updates->{$_} && !exists $fixed_fields{$_} }
-        $self->result_source->primary_columns;
+        $source->primary_columns;
     if ( !$object && !scalar @missing ) {
 
         # warn 'finding by: ' . Dumper( $updates ); use Data::Dumper;
@@ -96,8 +98,6 @@ sub recursive_update {
     #    warn 'updates: ' . Dumper( $updates ); use Data::Dumper;
     #    warn 'columns: ' . Dumper( \%columns_by_accessor );
     for my $name ( keys %$updates ) {
-        my $source = $self->result_source;
-
         # columns
         if ( exists $columns_by_accessor{$name}
             && !( $source->has_relationship($name)
This page took 0.022731 seconds and 4 git commands to generate.