From 9a0b9a90bf083215a3782eb9c3b152d6ce21db0c Mon Sep 17 00:00:00 2001 From: Ted Unangst Date: Thu, 11 Apr 2019 11:11:30 -0400 Subject: [PATCH] can improve efficiency of dedupe slightly without much complication --- activity.go | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/activity.go b/activity.go index f20ae57..7c09503 100644 --- a/activity.go +++ b/activity.go @@ -356,15 +356,13 @@ func newphone(a []string, obj map[string]interface{}) []string { 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