From: Eric Wong Date: Tue, 20 Dec 2016 23:42:35 +0000 (+0000) Subject: searchthread: update comment about loop prevention X-Git-Tag: v1.0.0~125 X-Git-Url: http://www.git.stargrave.org/?p=public-inbox.git;a=commitdiff_plain;h=93474f58d361b2ace4d5e51d5be4c220513da8d0 searchthread: update comment about loop prevention It definitely is necessary to prevent looping with the %seen hash. --- diff --git a/lib/PublicInbox/SearchThread.pm b/lib/PublicInbox/SearchThread.pm index 601a84b0..fafe7d7b 100644 --- a/lib/PublicInbox/SearchThread.pm +++ b/lib/PublicInbox/SearchThread.pm @@ -129,7 +129,7 @@ sub add_child { sub has_descendent { my ($self, $child) = @_; - my %seen; # loop prevention XXX may not be necessary + my %seen; # loop prevention while ($child) { return 1 if $self == $child || $seen{$child}++; $child = $child->{parent};