From: Peter Rabbitson Date: Wed, 1 Dec 2010 00:42:19 +0000 (+0100) Subject: Make the has-ident check in Row->update even lazier X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=014789be9f32ac051c53e703f61f0932a25e1b33;p=dbsrgits%2FDBIx-Class-Historic.git Make the has-ident check in Row->update even lazier --- diff --git a/lib/DBIx/Class/Row.pm b/lib/DBIx/Class/Row.pm index 19364ca..2713869 100644 --- a/lib/DBIx/Class/Row.pm +++ b/lib/DBIx/Class/Row.pm @@ -516,12 +516,12 @@ this method. sub update { my ($self, $upd) = @_; - my $ident_cond = $self->{_orig_ident} || $self->ident_condition; - $self->set_inflated_columns($upd) if $upd; - my %to_update = $self->get_dirty_columns; - return $self unless keys %to_update; + my %to_update = $self->get_dirty_columns + or return $self; + + my $ident_cond = $self->{_orig_ident} || $self->ident_condition; $self->throw_exception( "Not in database" ) unless $self->in_storage; $self->throw_exception($self->{_orig_ident_failreason})