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

Changed how find_alias tracks wildcards... coincidentaly this made nicktracking MUCH MUCH faster... on the huge bxlog it didnt even cause one second of slow down when it was on... try it out :)

sbingner 25 лет назад
Родитель
Сommit
3c23a809ca
1 измененных файлов с 7 добавлено и 5 удалено
  1. 7 5
      pisg.pl

+ 7 - 5
pisg.pl

@@ -312,8 +312,10 @@ sub init_config
                     foreach (@thisalias) {
                     foreach (@thisalias) {
                         if ($_ =~ s/\*/\.\*/g) {
                         if ($_ =~ s/\*/\.\*/g) {
                             $_ =~ s/([\[\]\{\}\-\^])/\\$1/g; # quote it if it is a wildcard
                             $_ =~ s/([\[\]\{\}\-\^])/\\$1/g; # quote it if it is a wildcard
+                            $conf->{aliaswilds}{$_} = $nick;
+                        } else {
+                            $alias{$_} = $nick;
                         }
                         }
-                        $alias{$_} = $nick;
                     }
                     }
                 }
                 }
 
 
@@ -1016,10 +1018,10 @@ sub find_alias
 
 
     if ($alias{$lcnick}) {
     if ($alias{$lcnick}) {
         return $alias{$lcnick};
         return $alias{$lcnick};
-    } else {
-        foreach (keys %alias) {
-            if (($_ =~ /\.\*/) && ($nick =~ /^$_$/i)) {
-                return $alias{$_};
+    } elsif ($conf->{aliaswilds}) {
+        foreach (keys %{ $conf->{aliaswilds} }) {
+            if ($nick =~ /^$_$/i) {
+                return $conf->{aliaswilds}{$_};
             }
             }
         }
         }
     }
     }