minor optimization
Rafael Kitover [Sat, 11 Jul 2009 12:36:53 +0000 (12:36 +0000)]
lib/DBIx/Class/Storage/DBI.pm

index 6f66848..a017ff3 100644 (file)
@@ -716,7 +716,11 @@ Returns the dbh - a data base handle of class L<DBI>.
 sub dbh {
   my ($self) = @_;
 
-  $self->ensure_connected;
+  if (not $self->_dbh) {
+    $self->_populate_dbh;
+  } else {
+    $self->ensure_connected;
+  }
   return $self->_dbh;
 }