Alexander Nazarov (nfokz) wrote in changelog,
Alexander Nazarov
nfokz
changelog

[livejournal] r21183: LJSUP-11247: Don't saved subject when us...

Committer: anazarov
LJSUP-11247: Don't saved subject when user left comment (s2 style)
U   trunk/cgi-bin/LJ/Talk.pm
Modified: trunk/cgi-bin/LJ/Talk.pm
===================================================================
--- trunk/cgi-bin/LJ/Talk.pm	2012-02-14 13:35:58 UTC (rev 21182)
+++ trunk/cgi-bin/LJ/Talk.pm	2012-02-14 13:36:19 UTC (rev 21183)
@@ -1616,19 +1616,19 @@
 
     my $max_subjects = $LJ::TALK_MAX_SUBJECTS || 200;
 
-    my (%subjects_to_load, $subjcounter);
+    my %subjects_to_load;
+    my $subjcounter = @check_for_children;
+
+    $subjects_to_load{$_}++ foreach @check_for_children;
+
     while (@check_for_children) {
         my $cfc = shift @check_for_children;
         next unless defined $children->{$cfc};
         foreach my $child (@{$children->{$cfc}}) {
             if (scalar(keys %posts_to_load) < $page_size || $opts->{expand_all}) {
                 $posts_to_load{$child} = 1;
-            }
-            elsif (scalar(keys %posts_to_load) < $page_size) {
-                $posts_to_load{$child} = 1;
             } else {
-                $subjcounter++;
-                $subjects_to_load{$child}++ if $subjcounter < $max_subjects;
+                $subjects_to_load{$child}++ if ++$subjcounter < $max_subjects;
             }
             push @check_for_children, $child;
         }

Tags: anazarov, livejournal, nfokz, 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