From: Rafael Kitover Date: Sat, 11 Jul 2009 12:36:53 +0000 (+0000) Subject: minor optimization X-Git-Tag: v0.08109~30^2~22 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=d8052984ee832d918f228cfd15129116f31a6093;p=dbsrgits%2FDBIx-Class.git minor optimization --- diff --git a/lib/DBIx/Class/Storage/DBI.pm b/lib/DBIx/Class/Storage/DBI.pm index 6f66848..a017ff3 100644 --- a/lib/DBIx/Class/Storage/DBI.pm +++ b/lib/DBIx/Class/Storage/DBI.pm @@ -716,7 +716,11 @@ Returns the dbh - a data base handle of class L. sub dbh { my ($self) = @_; - $self->ensure_connected; + if (not $self->_dbh) { + $self->_populate_dbh; + } else { + $self->ensure_connected; + } return $self->_dbh; }