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

* Revert most of the performance improvement changes, they caused bugs.
* Really fix topics with the mbot format.

Morten Brix Pedersen 22 лет назад
Родитель
Сommit
072809a30d
4 измененных файлов с 9 добавлено и 11 удалено
  1. 4 0
      docs/Changelog
  2. 1 1
      modules/Pisg.pm
  3. 1 1
      modules/Pisg/Parser/Format/mbot.pm
  4. 3 9
      modules/Pisg/Parser/Logfile.pm

+ 4 - 0
docs/Changelog

@@ -1,3 +1,7 @@
+pisg (x.xx)
+   * Revert most of the performance improvement changes, they caused bugs.
+   * Really fix topics with the mbot format.
+
 pisg (0.53) - Tue Mar, 23rd 2004
    * Several noticeable performance improvements (thanks, Hanno Hecker)
    * mIRC is no longer the default format. You have to always specify a format

+ 1 - 1
modules/Pisg.pm

@@ -197,7 +197,7 @@ sub get_default_config_settings
         botnicks => '',            # Needed for DCpp format (non-irc)
 
         dailyactivity => 0,
-        version => "0.53",
+        version => "0.54-cvs",
     };
 
     # This enables us to use the search_path in other modules

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

@@ -69,7 +69,7 @@ sub thirdline
             $hash{nick} = $5;
 
         } elsif ($4 eq 'TOPIC') {
-            $hash{newtopic} = $5.$6.$7;
+            $hash{newtopic} = $5." ".$6." ".$7;
 
         } elsif ($4 eq 'MODE') {
             $hash{newmode} = $5;

+ 3 - 9
modules/Pisg/Parser/Logfile.pm

@@ -315,7 +315,7 @@ sub _parse_file
 
                     $stats->{shouts}{$nick}++
                         if (index($saying, '!') > -1);
-                    study $saying;
+
                     if ($saying !~ /[a-z]/o && $saying =~ /[A-Z]/o) {
                         # Ignore single smileys on a line. eg. '<user> :P'
                         if ($saying !~ /^[8;:=][ ^-o]?[)pPD}\]>]$/o) {
@@ -539,18 +539,12 @@ sub _parse_words
     my ($stats, $saying, $nick, $ignorewords, $hour) = @_;
     # Cache time of day
     my $tod = int($hour/6);
-    my $word;
 
-    study $saying;
-    $saying =~ s/^[\s,!?.:;)(\"]+//o;
-    while ($saying =~ s/([^\s,!?.:;)(\"]+)([\s,!?.:;)(\"]+)?//og) {
-        $word = $1;
+    foreach my $word (split(/[\s,!?.:;)(\"]+/o, $saying)) {
         $stats->{words}{$nick}++;
         $stats->{word_times}{$nick}[$tod]++;
         # remove uninteresting words
-        next if $ignorewords and $word =~ m/$ignorewords/io;
-        # TODO: does the /o above provide the correct behaviour?
-        # next if $ignorewords and $word =~ m/$ignorewords/i;
+        next if $ignorewords and $word =~ m/$ignorewords/i;
 
         # ignore contractions
         next if ($word =~ m/'.{1,2}$/o);