X-Git-Url: http://www.git.stargrave.org/?a=blobdiff_plain;f=lib%2FPublicInbox%2FSearchThread.pm;h=450a06f43bc86f6266d32811e6efd507ffe94c7a;hb=ec2df4c3b80104a0bf15b0d917d82264bbf9b50e;hp=1d250b4672f0f674a4290136fe519b4cc83ff0a8;hpb=cfb8d16578e7f2f2e300f9f436205e4a8fc7f322;p=public-inbox.git diff --git a/lib/PublicInbox/SearchThread.pm b/lib/PublicInbox/SearchThread.pm index 1d250b46..450a06f4 100644 --- a/lib/PublicInbox/SearchThread.pm +++ b/lib/PublicInbox/SearchThread.pm @@ -76,7 +76,9 @@ sub _add_message ($$) { # C. Set the parent of this message to be the last element in # References. - $prev->add_child($this) if defined $prev; + if (defined $prev && !$this->has_descendent($prev)) { # would loop + $prev->add_child($this); + } } package PublicInbox::SearchThread::Msg;