[Jifty-commit] r4230 - in Jifty-DBI/trunk: lib/Jifty/DBI

jifty-commit at lists.jifty.org jifty-commit at lists.jifty.org
Wed Oct 10 22:56:31 EDT 2007


Author: jesse
Date: Wed Oct 10 22:56:30 2007
New Revision: 4230

Modified:
   Jifty-DBI/trunk/   (props changed)
   Jifty-DBI/trunk/lib/Jifty/DBI/Record.pm

Log:
 r68046 at pinglin:  jesse | 2007-10-10 21:48:07 -0500
  defined is not what you check to see if there is a hash entry. this will stop bogus extra sql calls that slowed down your app


Modified: Jifty-DBI/trunk/lib/Jifty/DBI/Record.pm
==============================================================================
--- Jifty-DBI/trunk/lib/Jifty/DBI/Record.pm	(original)
+++ Jifty-DBI/trunk/lib/Jifty/DBI/Record.pm	Wed Oct 10 22:56:30 2007
@@ -1030,7 +1030,7 @@
     $self->{values} = {};
     #foreach my $f ( keys %$hashref ) { $self->{'fetched'}{  $f } = 1; }
     foreach my $col (map {$_->name} $self->columns) {
-        next unless defined $hashref->{lc($col)};
+        next unless exists $hashref->{lc($col)};
         $self->{'fetched'}{$col} = 1;
         $self->{'values'}->{$col} = $hashref->{lc($col)};
 
@@ -1063,7 +1063,7 @@
     $self->{'decoded'} = {};
     #foreach my $f ( keys %$hashref ) { $self->{'fetched'}{  $f } = 1; }
     foreach my $col (map {$_->name} $self->columns) {
-        next unless defined $hashref->{lc($col)};
+        next unless exists $hashref->{lc($col)};
         $self->{'fetched'}{$col} = 1;
         $self->{'values'}->{$col} = $hashref->{lc($col)};
     }


More information about the Jifty-commit mailing list