]> Sergey Matveev's repositories - public-inbox.git/commitdiff
thread: order_children no longer cares about depth
authorEric Wong <e@80x24.org>
Wed, 5 Oct 2016 23:47:26 +0000 (23:47 +0000)
committerEric Wong <e@80x24.org>
Wed, 5 Oct 2016 23:53:33 +0000 (23:53 +0000)
We never use the depth anywhere in this sub

lib/PublicInbox/SearchThread.pm

index ba31f4322ae851c23a65fdfe6e96c0a42f28b601..2e7b79a0faaaa0d685b98272983114013a47532b 100644 (file)
@@ -203,7 +203,6 @@ sub order_children {
        my ($walk, $ordersub) = @_;
 
        my %seen;
-       my $depth = 0;
        my @visited;
        while ($walk) {
                push @visited, $walk;
@@ -222,17 +221,13 @@ sub order_children {
                }
 
                # go down, or across
-               if ($child) {
-                       $next = $child;
-                       ++$depth;
-               }
+               $next = $child if $child;
 
                # no next?  look up
                if (!$next) {
                        my $up = $walk;
                        while ($up && !$next) {
                                $up = $up->{parent};
-                               --$depth;
                                $next = $up->{next} if $up;
                        }
                }