4
0
Эх сурвалжийг харах

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 жил өмнө
parent
commit
3c23a809ca
1 өөрчлөгдсөн 7 нэмэгдсэн , 5 устгасан
  1. 7 5
      pisg.pl

+ 7 - 5
pisg.pl

@@ -312,8 +312,10 @@ sub init_config
                     foreach (@thisalias) {
                         if ($_ =~ s/\*/\.\*/g) {
                             $_ =~ 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}) {
         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}{$_};
             }
         }
     }