spamassassin-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From par...@apache.org
Subject svn commit: rev 54009 - spamassassin/branches/3.0/lib/Mail/SpamAssassin
Date Thu, 07 Oct 2004 19:43:30 GMT
Author: parker
Date: Thu Oct  7 12:43:29 2004
New Revision: 54009

Modified:
   spamassassin/branches/3.0/lib/Mail/SpamAssassin/Bayes.pm
Log:
Bug 3875: Remove map/grep combo and replace with foreach loop to avoid odd memory bloat issue

Modified: spamassassin/branches/3.0/lib/Mail/SpamAssassin/Bayes.pm
==============================================================================
--- spamassassin/branches/3.0/lib/Mail/SpamAssassin/Bayes.pm	(original)
+++ spamassassin/branches/3.0/lib/Mail/SpamAssassin/Bayes.pm	Thu Oct  7 12:43:29 2004
@@ -355,7 +355,11 @@
 
   # Go ahead and uniq the array, skip null tokens (can happen sometimes)
   # generate an SHA1 hash and take the lower 40 bits as our token
-  my %tokens = map { substr(sha1($_), -5) => { 'raw_token' => $_ } } grep(length, @tokens);
+  my %tokens;
+  foreach my $token (@tokens) {
+    next unless length($token); # skip 0 length tokens
+    $tokens{substr(sha1($token), -5)} = { 'raw_token' => $token };
+  }
 
   # return the keys == tokens ...
   return \%tokens;

Mime
View raw message