can improve efficiency of dedupe slightly without much complication
Ted Unangst tedu@tedunangst.com
Thu, 11 Apr 2019 11:11:30 -0400
1 files changed,
5 insertions(+),
7 deletions(-)
jump to
M
activity.go
→
activity.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