all repos — honk @ 418d9fb9a10e445a0fa7c641e9a6b59278ab1a32

my fork of honk

can improve efficiency of dedupe slightly without much complication
Ted Unangst tedu@tedunangst.com
Thu, 11 Apr 2019 11:11:30 -0400
commit

418d9fb9a10e445a0fa7c641e9a6b59278ab1a32

parent

22de29fa196462c93a85aeb15329d01955a9596a

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

jump to
M activity.goactivity.go

@@ -356,15 +356,13 @@

func oneofakind(a []string) []string { var x []string for n, s := range a { - for i := n + 1; i < len(a); i++ { - if a[i] == s { - a[i] = "" - } - } - } - for _, s := range a { if s != "" { x = append(x, s) + for i := n + 1; i < len(a); i++ { + if a[i] == s { + a[i] = "" + } + } } } return x