You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@spamassassin.apache.org by jm...@apache.org on 2007/08/03 16:37:55 UTC

svn commit: r562483 - /spamassassin/trunk/masses/rule-qa/corpus-hourly

Author: jm
Date: Fri Aug  3 07:37:54 2007
New Revision: 562483

URL: http://svn.apache.org/viewvc?view=rev&rev=562483
Log:
fix bug in new time_filter code; this is cleaner, and accurate for a change

Modified:
    spamassassin/trunk/masses/rule-qa/corpus-hourly

Modified: spamassassin/trunk/masses/rule-qa/corpus-hourly
URL: http://svn.apache.org/viewvc/spamassassin/trunk/masses/rule-qa/corpus-hourly?view=diff&rev=562483&r1=562482&r2=562483
==============================================================================
--- spamassassin/trunk/masses/rule-qa/corpus-hourly (original)
+++ spamassassin/trunk/masses/rule-qa/corpus-hourly Fri Aug  3 07:37:54 2007
@@ -247,19 +247,23 @@
 
 sub time_filter_fileset {
   my ($fileary, $outname, $after, $before) = @_;
+
+  my $timet_before = ($before ? ($time_start - ($before * WEEK)) : undef);
+  my $timet_after  = ($after ? ($time_start - ($after * WEEK)) : undef);
+
   open(TMP, "> $outname") or warn "cannot write $outname";
   for my $file (@{$fileary}) {
     open(IN, $file) or warn "cannot read $file";
-
     while (<IN>) {
       if (/time=(\d+)/) {
-        print TMP if (($time_start - $1 >= WEEK * $after) &&
-                      (!$before || ($time_start - $1 < WEEK * $before)));
+        next if (defined($timet_after) && $1 < $timet_after);
+        next if (defined($timet_before) && $1 > $timet_before);
+        print TMP;
       }
     }
-    close(IN);
+    close IN;
   }
-  close (TMP);
+  close TMP;
 }