can improve efficiency of dedupe slightly without much complication

This commit is contained in:
Ted Unangst 2019-04-11 11:11:30 -04:00
parent 8d966a1d50
commit 9a0b9a90bf
1 changed files with 5 additions and 7 deletions

View File

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