[Bast-commits] r9735 - SQL-Abstract/1.x/trunk/lib/SQL/Abstract

ribasushi at dev.catalyst.perl.org ribasushi at dev.catalyst.perl.org
Wed Sep 22 10:09:34 GMT 2010


Author: ribasushi
Date: 2010-09-22 11:09:34 +0100 (Wed, 22 Sep 2010)
New Revision: 9735

Modified:
   SQL-Abstract/1.x/trunk/lib/SQL/Abstract/Test.pm
Log:
Replace one more grep with a regex

Modified: SQL-Abstract/1.x/trunk/lib/SQL/Abstract/Test.pm
===================================================================
--- SQL-Abstract/1.x/trunk/lib/SQL/Abstract/Test.pm	2010-09-22 10:01:59 UTC (rev 9734)
+++ SQL-Abstract/1.x/trunk/lib/SQL/Abstract/Test.pm	2010-09-22 10:09:34 UTC (rev 9735)
@@ -26,6 +26,8 @@
   'HAVING',
   'ORDER \s+ BY',
 );
+my $unrollable_ops_re = join ' | ', @unrollable_ops;
+$unrollable_ops_re = qr/$unrollable_ops_re/xio;
 
 sub is_same_sql_bind {
   my ($sql1, $bind_ref1, $sql2, $bind_ref2, $msg) = @_;
@@ -228,7 +230,7 @@
       }
 
       # if the parent operator explcitly allows it nuke the parenthesis
-      elsif ( grep { $ast->[0] =~ /^ $_ $/xi } @unrollable_ops ) {
+      elsif ( $ast->[0] =~ $unrollable_ops_re ) {
         push @children, $child->[1][0];
         $changes++;
       }




More information about the Bast-commits mailing list