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 243821F4F8 for ; Wed, 5 Oct 2016 23:57:27 +0000 (UTC) From: Eric Wong To: meta@public-inbox.org Subject: [PATCH 10/17] thread: avoid incrementing undefined value Date: Wed, 5 Oct 2016 23:57:15 +0000 Message-Id: <20161005235722.14857-11-e@80x24.org> In-Reply-To: <20161005235722.14857-1-e@80x24.org> References: <20161005235722.14857-1-e@80x24.org> List-Id: It is pointless to increment when setting a true value is simpler as there is no need to read before writing. --- lib/PublicInbox/SearchThread.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/PublicInbox/SearchThread.pm b/lib/PublicInbox/SearchThread.pm index dad783e..ba31f43 100644 --- a/lib/PublicInbox/SearchThread.pm +++ b/lib/PublicInbox/SearchThread.pm @@ -179,7 +179,7 @@ sub recurse_down { my %seen; my @q = ($self); while (my $cont = shift @q) { - $seen{$cont}++; + $seen{$cont} = 1; $callback->($cont); if (my $next = $cont->{next}) { @@ -209,7 +209,7 @@ sub order_children { push @visited, $walk; # spot/break loops - $seen{$walk}++; + $seen{$walk} = 1; my $child = $walk->{child}; if ($child && $seen{$child}) { -- EW