From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-4.0 required=3.0 tests=ALL_TRUSTED,BAYES_00 shortcircuit=no autolearn=ham autolearn_force=no version=3.4.0 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id 58648209C0 for ; Wed, 5 Oct 2016 23:57:27 +0000 (UTC) From: Eric Wong To: meta@public-inbox.org Subject: [PATCH 11/17] thread: order_children no longer cares about depth Date: Wed, 5 Oct 2016 23:57:16 +0000 Message-Id: <20161005235722.14857-12-e@80x24.org> In-Reply-To: <20161005235722.14857-1-e@80x24.org> References: <20161005235722.14857-1-e@80x24.org> List-Id: We never use the depth anywhere in this sub --- lib/PublicInbox/SearchThread.pm | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/lib/PublicInbox/SearchThread.pm b/lib/PublicInbox/SearchThread.pm index ba31f43..2e7b79a 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; } } -- EW