From cd7518c0a5e329e9bc6d4c9ab0b05279b4a954c0 Mon Sep 17 00:00:00 2001 From: Ted Unangst Date: Sun, 18 Jun 2023 21:22:21 -0400 Subject: [PATCH] sometimes a thread gets weird. don't double process trees. --- web.go | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/web.go b/web.go index b862f54..b55a4dd 100644 --- a/web.go +++ b/web.go @@ -1052,16 +1052,18 @@ func threadsort(honks []*Honk) []*Honk { return childs[i].Honker == p.Honker && childs[j].Honker != p.Honker }) for _, h := range childs { - done[h] = true - thread = append(thread, h) - nextlevel(h) + if !done[h] { + done[h] = true + thread = append(thread, h) + nextlevel(h) + } } if levelup { level-- } } for _, h := range honks { - if h.RID == "" { + if !done[h] && h.RID == "" { done[h] = true thread = append(thread, h) nextlevel(h)