[Bast-commits] r4204 - DBIx-Class/0.08/trunk/lib/DBIx/Class/CDBICompat

schwern at dev.catalyst.perl.org schwern at dev.catalyst.perl.org
Fri Mar 14 22:50:05 GMT 2008


Author: schwern
Date: 2008-03-14 22:50:04 +0000 (Fri, 14 Mar 2008)
New Revision: 4204

Modified:
   DBIx-Class/0.08/trunk/lib/DBIx/Class/CDBICompat/Iterator.pm
Log:
A little performance hack to speed up efficiency.  Internal checks that the
resultset is defined would make a SQL COUNT happen.

Modified: DBIx-Class/0.08/trunk/lib/DBIx/Class/CDBICompat/Iterator.pm
===================================================================
--- DBIx-Class/0.08/trunk/lib/DBIx/Class/CDBICompat/Iterator.pm	2008-03-14 22:03:47 UTC (rev 4203)
+++ DBIx-Class/0.08/trunk/lib/DBIx/Class/CDBICompat/Iterator.pm	2008-03-14 22:50:04 UTC (rev 4204)
@@ -3,6 +3,7 @@
 use strict;
 use warnings;
 
+
 =head1 NAME
 
 DBIx::Class::CDBICompat::Iterator
@@ -41,7 +42,11 @@
 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;




More information about the Bast-commits mailing list