From: Eric Wong <e@80x24.org>
Date: Wed, 5 Oct 2016 23:47:25 +0000 (+0000)
Subject: thread: avoid incrementing undefined value
X-Git-Tag: v1.0.0~173
X-Git-Url: http://www.git.stargrave.org/?a=commitdiff_plain;h=465d6b11e0bc800e45057bef89df37f265ecd5c0;p=public-inbox.git

thread: avoid incrementing undefined value

It is pointless to increment when setting a true value is
simpler as there is no need to read before writing.
---

diff --git a/lib/PublicInbox/SearchThread.pm b/lib/PublicInbox/SearchThread.pm
index dad783ef..ba31f432 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}) {