speedup stats creation
authorDobrica Pavlinusic <dpavlin@rot13.org>
Tue, 25 May 2010 15:42:26 +0000 (17:42 +0200)
committerDobrica Pavlinusic <dpavlin@rot13.org>
Tue, 25 May 2010 15:42:26 +0000 (17:42 +0200)
lib/MojoFacets/Data.pm

index b4f1258..698a793 100644 (file)
@@ -115,7 +115,7 @@ sub _load_path {
                                $stats->{$n}->{numeric}++
                                        if $x =~ m/^[-+]?([0-9]*\.[0-9]+|[0-9]+)$/;
                                $stats->{$n}->{empty}++
-                                       if $x =~ m/^\s*$/;
+                                       if length $x == 0; # faster than $x =~ m/^\s*$/;
                        }
 
                }