all repos — honk @ 723b750220f65963467d46cbe86c661dfcbd8c52

my fork of honk

less inefficient compaction
Ted Unangst tedu@tedunangst.com
Tue, 16 Apr 2019 22:36:05 -0400
commit

723b750220f65963467d46cbe86c661dfcbd8c52

parent

7c1a4dc7fd6c3b89d7696c7b44eb5dd7499d4581

1 files changed, 5 insertions(+), 4 deletions(-)

jump to
M fun.gofun.go

@@ -64,13 +64,14 @@ }

return e } h.HTML = template.HTML(re_emus.ReplaceAllStringFunc(string(h.HTML), emuxifier)) + j := 0 for i := 0; i < len(h.Donks); i++ { - if zap[h.Donks[i]] { - copy(h.Donks[i:], h.Donks[i+1:]) - h.Donks = h.Donks[:len(h.Donks)-1] - i-- + if !zap[h.Donks[i]] { + h.Donks[j] = h.Donks[i] + j++ } } + h.Donks = h.Donks[:j] } }