Remove anonymous blesses to avoid major speed hit on Fedora Core 5, or 'the anti...
[dbsrgits/DBIx-Class.git] / lib / DBIx / Class / Storage / Statistics.pm
index 60b59cd..eaa3ee9 100644 (file)
@@ -30,7 +30,8 @@ Returns a new L<DBIx::Class::Storage::Statistics> object.
 
 =cut
 sub new {
-    my $self = bless({}, ref($_[0]) || $_[0]);
+    my $self = {};
+    bless $self, (ref($_[0]) || $_[0]);
 
     return $self;
 }
@@ -82,16 +83,17 @@ executed and subsequent arguments are the parameters used for the query.
 
 =cut
 sub query_start {
-    my $self = shift();
-    my $string = shift();
+    my ($self, $string, @bind) = @_;
+
+    my $message = "$string: ".join(', ', @bind)."\n";
 
     if(defined($self->callback())) {
       $string =~ m/^(\w+)/;
-      $self->callback()->($1, $string);
+      $self->callback()->($1, $message);
       return;
     }
 
-    $self->debugfh->print("$string: " . join(', ', @_) . "\n");
+    $self->debugfh->print($message);
 }
 
 =head2 query_end