From: Eric Wong Date: Wed, 5 Oct 2016 23:47:26 +0000 (+0000) Subject: thread: order_children no longer cares about depth X-Git-Tag: v1.0.0~172 X-Git-Url: http://www.git.stargrave.org/?p=public-inbox.git;a=commitdiff_plain;h=0412f55abd34d90e4efe0b28217d79fa8319834f thread: order_children no longer cares about depth We never use the depth anywhere in this sub --- diff --git a/lib/PublicInbox/SearchThread.pm b/lib/PublicInbox/SearchThread.pm index ba31f432..2e7b79a0 100644 --- a/lib/PublicInbox/SearchThread.pm +++ b/lib/PublicInbox/SearchThread.pm @@ -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; } }