spamassassin-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From par...@apache.org
Subject svn commit: r125997 - /spamassassin/trunk/lib/Mail/SpamAssassin/DBBasedAddrList.pm
Date Sat, 22 Jan 2005 03:48:22 GMT
Author: parker
Date: Fri Jan 21 19:48:20 2005
New Revision: 125997

URL: http://svn.apache.org/viewcvs?view=rev&rev=125997
Log:
Bug 4075: use each instead of grep/keys to avoid reading large chunks of the autowhitelist
into memory
Modified:
   spamassassin/trunk/lib/Mail/SpamAssassin/DBBasedAddrList.pm

Modified: spamassassin/trunk/lib/Mail/SpamAssassin/DBBasedAddrList.pm
Url: http://svn.apache.org/viewcvs/spamassassin/trunk/lib/Mail/SpamAssassin/DBBasedAddrList.pm?view=diff&rev=125997&p1=spamassassin/trunk/lib/Mail/SpamAssassin/DBBasedAddrList.pm&r1=125996&p2=spamassassin/trunk/lib/Mail/SpamAssassin/DBBasedAddrList.pm&r2=125997
==============================================================================
--- spamassassin/trunk/lib/Mail/SpamAssassin/DBBasedAddrList.pm	(original)
+++ spamassassin/trunk/lib/Mail/SpamAssassin/DBBasedAddrList.pm	Fri Jan 21 19:48:20 2005
@@ -167,11 +167,12 @@
     # try to delete any per-IP entries for this addr as well.
     # could be slow...
     my $mailaddr = $1;
-    my @keys = grep { /^\Q${mailaddr}\E\|ip=\d+\.\d+$/ }
-					keys %{$self->{accum}};
-    foreach my $key (@keys) {
-      delete $self->{accum}->{$key};
-      delete $self->{accum}->{$key.'|totscore'};
+
+    while (my ($key, $value) = each %{$self->{accum}}) {
+      if ($key =~ /^\Q${mailaddr}\E\|ip=\d+\.\d+$/) {
+        delete $self->{accum}->{$key};
+        delete $self->{accum}->{$key.'|totscore'};
+      }
     }
   }
 }

Mime
View raw message