Просмотр исходного кода

Add 'compile only once' modifier to pattern matching, hopefully gain a few
nanoseconds

Morten Brix Pedersen 24 лет назад
Родитель
Сommit
5c3aa16f54

+ 3 - 3
modules/Pisg/Parser/Format/Template.pm

@@ -35,7 +35,7 @@ sub normalline
     my ($self, $line, $lines) = @_;
     my %hash;
 
-    if ($line =~ /$self->{normalline}/) {
+    if ($line =~ /$self->{normalline}/o) {
         $self->{debug}->("[$lines] Normal: $1 $2 $3");
 
         # Most log formats are regular enough that you can just match the
@@ -57,7 +57,7 @@ sub actionline
     my ($self, $line, $lines) = @_;
     my %hash;
 
-    if ($line =~ /$self->{actionline}/) {
+    if ($line =~ /$self->{actionline}/o) {
         $self->{debug}->("[$lines] Action: $1 $2 $3");
 
         # Most log formats are regular enough that you can just match the
@@ -93,7 +93,7 @@ sub thirdline
     my ($self, $line, $lines) = @_;
     my %hash;
 
-    if ($line =~ /$self->{thirdline}/) {
+    if ($line =~ /$self->{thirdline}/o) {
         $self->{debug}->("[$lines] ***: $1 $2 $3 $4 $5 $6 $7 $8 $9");
 
         $hash{hour} = $1;

+ 3 - 3
modules/Pisg/Parser/Format/bxlog.pm

@@ -25,7 +25,7 @@ sub normalline
     my ($self, $line, $lines) = @_;
     my %hash;
 
-    if ($line =~ /$self->{normalline}/) {
+    if ($line =~ /$self->{normalline}/o) {
         $self->{debug}->("[$lines] Normal: $1 $2 $3");
 
         $hash{hour}   = $1;
@@ -43,7 +43,7 @@ sub actionline
     my ($self, $line, $lines) = @_;
     my %hash;
 
-    if ($line =~ /$self->{actionline}/) {
+    if ($line =~ /$self->{actionline}/o) {
         $self->{debug}->("[$lines] Action: $1 $2 $3");
 
         $hash{hour}    = $1;
@@ -61,7 +61,7 @@ sub thirdline
     my ($self, $line, $lines) = @_;
     my %hash;
 
-    if ($line =~ /$self->{thirdline}/) {
+    if ($line =~ /$self->{thirdline}/o) {
         $self->{debug}->("[$lines] ***: $1 $2 $3 $4");
 
         $hash{hour} = $1;

+ 3 - 3
modules/Pisg/Parser/Format/eggdrop.pm

@@ -25,7 +25,7 @@ sub normalline
     my ($self, $line, $lines) = @_;
     my %hash;
 
-    if ($line =~ /$self->{normalline}/) {
+    if ($line =~ /$self->{normalline}/o) {
         $self->{debug}->("[$lines] Normal: $1 $2 $3");
 
         $hash{hour}   = $1;
@@ -43,7 +43,7 @@ sub actionline
     my ($self, $line, $lines) = @_;
     my %hash;
 
-    if ($line =~ /$self->{actionline}/) {
+    if ($line =~ /$self->{actionline}/o) {
         $self->{debug}->("[$lines] Action: $1 $2 $3");
 
         $hash{hour}   = $1;
@@ -61,7 +61,7 @@ sub thirdline
     my ($self, $line, $lines) = @_;
     my %hash;
 
-    if ($line =~ /$self->{thirdline}/) {
+    if ($line =~ /$self->{thirdline}/o) {
         if (defined $7) {
             $self->{debug}->("[$lines] ***: $1 $2 $3 $4 $5 $6 $7");
         } else {

+ 3 - 3
modules/Pisg/Parser/Format/grufti.pm

@@ -25,7 +25,7 @@ sub normalline
     my ($self, $line, $lines) = @_;
     my %hash;
 
-    if ($line =~ /$self->{normalline}/) {
+    if ($line =~ /$self->{normalline}/o) {
         $self->{debug}->("[$lines] Normal: $1 $2 $3");
 
         $hash{hour}   = $1;
@@ -43,7 +43,7 @@ sub actionline
     my ($self, $line, $lines) = @_;
     my %hash;
 
-    if ($line =~ /$self->{actionline}/) {
+    if ($line =~ /$self->{actionline}/o) {
         $self->{debug}->("[$lines] Action: $1 $2 $3");
 
         $hash{hour}   = $1;
@@ -61,7 +61,7 @@ sub thirdline
     my ($self, $line, $lines) = @_;
     my %hash;
 
-    if ($line =~ /$self->{thirdline}/) {
+    if ($line =~ /$self->{thirdline}/o) {
         if (defined $9) {
             $self->{debug}->("[$lines] ***: $1 $2 $3 $4 $5 $6 $7 $8 $9");
         } else {

+ 3 - 3
modules/Pisg/Parser/Format/ircle.pm

@@ -25,7 +25,7 @@ sub normalline
     my ($self, $line, $lines) = @_;
     my %hash;
 
-    if ($line =~ /$self->{normalline}/) {
+    if ($line =~ /$self->{normalline}/o) {
         $self->{debug}->("[$lines] Normal: $1 $2 $3");
 
         $hash{hour}   = $1;
@@ -43,7 +43,7 @@ sub actionline
     my ($self, $line, $lines) = @_;
     my %hash;
 
-    if ($line =~ /$self->{actionline}/) {
+    if ($line =~ /$self->{actionline}/o) {
         $self->{debug}->("[$lines] Action: $1 $2 $3");
 
         $hash{hour}   = $1;
@@ -61,7 +61,7 @@ sub thirdline
     my ($self, $line, $lines) = @_;
     my %hash;
 
-    if ($line =~ /$self->{thirdline}/) {
+    if ($line =~ /$self->{thirdline}/o) {
         if (defined $8) {
             $self->{debug}->("[$lines] ***: $1 $2 $3 $4 $5 $6 $7 $8");
         } else {

+ 3 - 3
modules/Pisg/Parser/Format/irssi.pm

@@ -25,7 +25,7 @@ sub normalline
     my ($self, $line, $lines) = @_;
     my %hash;
 
-    if ($line =~ /$self->{normalline}/) {
+    if ($line =~ /$self->{normalline}/o) {
         $self->{debug}->("[$lines] Normal: $1 $2 $3");
 
         $hash{hour}   = $1;
@@ -43,7 +43,7 @@ sub actionline
     my ($self, $line, $lines) = @_;
     my %hash;
 
-    if ($line =~ /$self->{actionline}/) {
+    if ($line =~ /$self->{actionline}/o) {
         $self->{debug}->("[$lines] Action: $1 $2 $3");
 
         $hash{hour}   = $1;
@@ -61,7 +61,7 @@ sub thirdline
     my ($self, $line, $lines) = @_;
     my %hash;
 
-    if ($line =~ /$self->{thirdline}/) {
+    if ($line =~ /$self->{thirdline}/o) {
         if (defined $8) {
             $self->{debug}->("[$lines] ***: $1 $2 $3 $4 $5 $6 $7 $8");
         } else {

+ 3 - 3
modules/Pisg/Parser/Format/mIRC.pm

@@ -25,7 +25,7 @@ sub normalline
     my ($self, $line, $lines) = @_;
     my %hash;
 
-    if ($line =~ /$self->{normalline}/) {
+    if ($line =~ /$self->{normalline}/o) {
         $self->{debug}->("[$lines] Normal: $1 $2 $3");
 
         $hash{hour}   = $1;
@@ -43,7 +43,7 @@ sub actionline
     my ($self, $line, $lines) = @_;
     my %hash;
 
-    if ($line =~ /$self->{actionline}/) {
+    if ($line =~ /$self->{actionline}/o) {
         $self->{debug}->("[$lines] Action: $1 $2 $3");
 
         $hash{hour}   = $1;
@@ -61,7 +61,7 @@ sub thirdline
     my ($self, $line, $lines) = @_;
     my %hash;
 
-    if ($line =~ /$self->{thirdline}/) {
+    if ($line =~ /$self->{thirdline}/o) {
         if (defined $8) {
             $self->{debug}->("[$lines] ***: $1 $2 $3 $4 $5 $6 $7 $8");
         } else {

+ 3 - 3
modules/Pisg/Parser/Format/mbot.pm

@@ -25,7 +25,7 @@ sub normalline
     my ($self, $line, $lines) = @_;
     my %hash;
 
-    if ($line =~ /$self->{normalline}/) {
+    if ($line =~ /$self->{normalline}/o) {
         $self->{debug}->("[$lines] Normal: $1 $2 $3");
 
         $hash{hour}   = $1;
@@ -43,7 +43,7 @@ sub actionline
     my ($self, $line, $lines) = @_;
     my %hash;
 
-    if ($line =~ /$self->{actionline}/) {
+    if ($line =~ /$self->{actionline}/o) {
         $self->{debug}->("[$lines] Action: $1 $2 $3");
 
         $hash{hour}   = $1;
@@ -61,7 +61,7 @@ sub thirdline
     my ($self, $line, $lines) = @_;
     my %hash;
 
-    if ($line =~ /$self->{thirdline}/) {
+    if ($line =~ /$self->{thirdline}/o) {
         my $debugstring = "[$lines] ***: $1 $2 $3 $4";
         $debugstring .= " $5" if (defined $5);
         $debugstring .= " $6" if (defined $6);

+ 3 - 3
modules/Pisg/Parser/Format/psybnc.pm

@@ -25,7 +25,7 @@ sub normalline
     my ($self, $line, $lines) = @_;
     my %hash;
 
-    if ($line =~ /$self->{normalline}/) {
+    if ($line =~ /$self->{normalline}/o) {
         $self->{debug}->("[$lines] Normal: $1 $2 $3");
 
         $hash{hour}   = $1;
@@ -43,7 +43,7 @@ sub actionline
     my ($self, $line, $lines) = @_;
     my %hash;
 
-    if ($line =~ /$self->{actionline}/) {
+    if ($line =~ /$self->{actionline}/o) {
         $self->{debug}->("[$lines] Action: $1 $2 $3");
 
         $hash{hour}   = $1;
@@ -61,7 +61,7 @@ sub thirdline
     my ($self, $line, $lines) = @_;
     my %hash;
 
-    if ($line =~ /$self->{thirdline}/) {
+    if ($line =~ /$self->{thirdline}/o) {
         $self->{debug}->("[$lines] ***: $1 $2 $3 $4 $5");
 
         $hash{hour} = $1;

+ 3 - 3
modules/Pisg/Parser/Format/winbot.pm

@@ -25,7 +25,7 @@ sub normalline
     my ($self, $line, $lines) = @_;
     my %hash;
 
-    if ($line =~ /$self->{normalline}/ && $3 eq $self->{cfg}->{channel}) {
+    if ($line =~ /$self->{normalline}/o && $3 eq $self->{cfg}->{channel}) {
         $self->{debug}->("[$lines] Normal: $1 $2 $3 $4");
 
         $hash{hour}   = $1;
@@ -42,7 +42,7 @@ sub actionline
     my ($self, $line, $lines) = @_;
     my %hash;
 
-    if ($line =~ /$self->{actionline}/ && $3 eq $self->{cfg}->{channel}) {
+    if ($line =~ /$self->{actionline}/o && $3 eq $self->{cfg}->{channel}) {
         $self->{debug}->("[$lines] Action: $1 $2 $3 $4");
 
         $hash{hour}   = $1;
@@ -59,7 +59,7 @@ sub thirdline
     my ($self, $line, $lines) = @_;
     my %hash;
 
-    if ($line =~ /$self->{thirdline}/) {
+    if ($line =~ /$self->{thirdline}/o) {
         $self->{debug}->("[$lines] ***: $1 $2 $3");
 
         $hash{hour} = $1;

+ 3 - 3
modules/Pisg/Parser/Format/xchat.pm

@@ -25,7 +25,7 @@ sub normalline
     my ($self, $line, $lines) = @_;
     my %hash;
 
-    if ($line =~ /$self->{normalline}/) {
+    if ($line =~ /$self->{normalline}/o) {
         $self->{debug}->("[$lines] Normal: $1 $2 $3");
 
         $hash{hour} = $1;
@@ -43,7 +43,7 @@ sub actionline
     my ($self, $line, $lines) = @_;
     my %hash;
 
-    if ($line =~ /$self->{actionline}/) {
+    if ($line =~ /$self->{actionline}/o) {
         $self->{debug}->("[$lines] Action: $1 $2 $3");
 
         $hash{hour} = $1;
@@ -61,7 +61,7 @@ sub thirdline
     my ($self, $line, $lines) = @_;
     my %hash;
 
-    if ($line =~ /$self->{thirdline}/) {
+    if ($line =~ /$self->{thirdline}/o) {
         $self->{debug}->("[$lines] ***: $1 $2 $3 $4 $5 $6 $7 $8 $9");
 
         $hash{hour} = $1;

+ 3 - 3
modules/Pisg/Parser/Format/zcbot.pm

@@ -25,7 +25,7 @@ sub normalline
     my ($self, $line, $lines) = @_;
     my %hash;
 
-    if ($line =~ /$self->{normalline}/ && lc($3) eq lc($self->{cfg}->{channel})) {
+    if ($line =~ /$self->{normalline}/o && lc($3) eq lc($self->{cfg}->{channel})) {
         $self->{debug}->("[$lines] Normal: $1 $2 $3 $4");
 
         $hash{hour}   = $1;
@@ -43,7 +43,7 @@ sub actionline
     my ($self, $line, $lines) = @_;
     my %hash;
 
-    if ($line =~ /$self->{actionline}/ && lc($3) eq lc($self->{cfg}->{channel})) {
+    if ($line =~ /$self->{actionline}/o && lc($3) eq lc($self->{cfg}->{channel})) {
         $self->{debug}->("[$lines] Action: $1 $2 $3 $4");
 
         $hash{hour}   = $1;
@@ -62,7 +62,7 @@ sub thirdline
     my %hash;
     my $tmp;
     
-    if ($line =~ /$self->{thirdline}/) {
+    if ($line =~ /$self->{thirdline}/o) {
         $self->{debug}->("[$lines] ***: $1 $2 $3 $4 $5");
 
         $hash{hour} = $1;