From: Michael G Schwern Date: Fri, 14 Mar 2008 22:50:04 +0000 (+0000) Subject: A little performance hack to speed up efficiency. Internal checks that the X-Git-Tag: v0.08240~517 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=195dabc758d808c03fedc3c8d95b290770100421;p=dbsrgits%2FDBIx-Class.git A little performance hack to speed up efficiency. Internal checks that the resultset is defined would make a SQL COUNT happen. --- diff --git a/lib/DBIx/Class/CDBICompat/Iterator.pm b/lib/DBIx/Class/CDBICompat/Iterator.pm index 1b96835..3466769 100644 --- a/lib/DBIx/Class/CDBICompat/Iterator.pm +++ b/lib/DBIx/Class/CDBICompat/Iterator.pm @@ -3,6 +3,7 @@ package DBIx::Class::CDBICompat::Iterator; use strict; use warnings; + =head1 NAME DBIx::Class::CDBICompat::Iterator @@ -41,7 +42,11 @@ use warnings; use base qw(DBIx::Class::ResultSet); sub _bool { - return $_[0]->count; + # Performance hack so internal checks whether the result set + # exists won't do a SQL COUNT. + return 1 if caller =~ /^DBIx::Class::/; + + return $_[0]->count; } 1;