Андрей (andy) wrote in changelog,
Андрей
andy
changelog

[livejournal] r16159: LJSV-915 (ESN refactoring, part 1 // Tra...

Committer: ailyin
LJSV-915 (ESN refactoring, part 1 // Tracking subscription: access level and letter format errors): write checks in a more reliable way

U   trunk/cgi-bin/LJ/ESN.pm
Modified: trunk/cgi-bin/LJ/ESN.pm
===================================================================
--- trunk/cgi-bin/LJ/ESN.pm	2010-01-28 09:34:04 UTC (rev 16158)
+++ trunk/cgi-bin/LJ/ESN.pm	2010-01-28 09:47:30 UTC (rev 16159)
@@ -46,13 +46,17 @@
         warn "jobs of unique subs (@subs) matching event (@$params)\n";
     }
 
-    @subs = grep {
-        defined $_ &&
-        $evt->available_for_user($_->owner) &&
-        $evt->matches_filter($_);
-    } @subs;
+    my @subs_filtered;
+    
+    foreach my $sub (@subs) {
+        next unless defined $sub;
+        next unless $evt->available_for_user($sub->owner);
+        next unless $evt->matches_filter($sub);
 
-    foreach my $s (@subs) {
+        push @subs_filtered, $sub;
+    }
+    
+    foreach my $s (@subs_filtered) {
         next if $has_done{$s->unique}++;
         push @subjobs, TheSchwartz::Job->new(
             funcname => 'LJ::Worker::ProcessSub',

Tags: andy, livejournal, pm
Subscribe

  • Post a new comment

    Error

    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded 

  • 0 comments