From: Peter Rabbitson Date: Wed, 1 Jul 2009 11:27:15 +0000 (+0000) Subject: Optimize set_column on uninserted objects X-Git-Tag: v0.08108~36 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=cad745b2e0ee84d660060fcb7c69536688281188;p=dbsrgits%2FDBIx-Class.git Optimize set_column on uninserted objects --- diff --git a/lib/DBIx/Class/Row.pm b/lib/DBIx/Class/Row.pm index c3c70c6..f1e4846 100644 --- a/lib/DBIx/Class/Row.pm +++ b/lib/DBIx/Class/Row.pm @@ -787,7 +787,10 @@ sub set_column { $self->store_column($column, $new_value); my $dirty; - if (defined $old_value xor defined $new_value) { + if (!$self->in_storage) { # no point tracking dirtyness on uninserted data + $dirty = 1; + } + elsif (defined $old_value xor defined $new_value) { $dirty = 1; } elsif (not defined $old_value) { # both undef