From: Luke Saunders Date: Tue, 18 May 2010 16:21:38 +0000 (+0100) Subject: optimsation to avoid unnecessary finds X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=2aec43ca974c71c659b443142275dafec2c64d7e;p=dbsrgits%2FDBIx-Class-ResultSet-WithMetaData.git optimsation to avoid unnecessary finds --- diff --git a/lib/DBIx/Class/ResultSet/WithMetaData.pm b/lib/DBIx/Class/ResultSet/WithMetaData.pm index 1cf546b..e2ab12b 100644 --- a/lib/DBIx/Class/ResultSet/WithMetaData.pm +++ b/lib/DBIx/Class/ResultSet/WithMetaData.pm @@ -157,7 +157,8 @@ method add_row_info (%opts) { if ($row) { $id = $self->_mk_id(row => { $row->get_columns }); } - unless ($self->find($id)) { + + unless ($row || $self->find($id)) { die 'invalid id passed to add_row_info'; }