Remove forgotten frame from Storage-method overrides (was missing
Peter Rabbitson [Tue, 31 Aug 2010 10:22:45 +0000 (12:22 +0200)]
a goto in the driver-already-determined shim)
Simplify the DBI Cursor DESTROY a little

lib/DBIx/Class/Storage/DBI.pm
lib/DBIx/Class/Storage/DBI/Cursor.pm

index 3440ebb..ef02092 100644 (file)
@@ -72,7 +72,6 @@ my @rdbms_specific_methods = qw/
   build_datetime_parser
   datetime_parser_type
 
-
   insert
   insert_bulk
   update
@@ -96,7 +95,7 @@ for my $meth (@rdbms_specific_methods) {
       $_[0]->_determine_driver;
       goto $_[0]->can($meth);
     }
-    $orig->(@_);
+    goto $orig;
   };
 }
 
index a73eb52..5eefed0 100644 (file)
@@ -177,11 +177,10 @@ sub _check_dbh_gen {
 }
 
 sub DESTROY {
-  my ($self) = @_;
-
   # None of the reasons this would die matter if we're in DESTROY anyways
-  try { $self->sth->finish }
-    if $self->sth && $self->sth->{Active};
+  if (my $sth = $_[0]->sth) {
+    try { $sth->finish if $sth->{Active} };
+  }
 }
 
 1;