less inefficient compaction

master
Ted Unangst 6 years ago
parent 61b91a84f1
commit ffcd597027

@ -64,13 +64,14 @@ func reverbolate(honks []*Honk) {
return e return e
} }
h.HTML = template.HTML(re_emus.ReplaceAllStringFunc(string(h.HTML), emuxifier)) h.HTML = template.HTML(re_emus.ReplaceAllStringFunc(string(h.HTML), emuxifier))
j := 0
for i := 0; i < len(h.Donks); i++ { for i := 0; i < len(h.Donks); i++ {
if zap[h.Donks[i]] { if !zap[h.Donks[i]] {
copy(h.Donks[i:], h.Donks[i+1:]) h.Donks[j] = h.Donks[i]
h.Donks = h.Donks[:len(h.Donks)-1] j++
i--
} }
} }
h.Donks = h.Donks[:j]
} }
} }

Loading…
Cancel
Save