can improve efficiency of dedupe slightly without much complication
This commit is contained in:
parent
8d966a1d50
commit
9a0b9a90bf
12
activity.go
12
activity.go
|
@ -356,15 +356,13 @@ func newphone(a []string, obj map[string]interface{}) []string {
|
||||||
func oneofakind(a []string) []string {
|
func oneofakind(a []string) []string {
|
||||||
var x []string
|
var x []string
|
||||||
for n, s := range a {
|
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 != "" {
|
if s != "" {
|
||||||
x = append(x, s)
|
x = append(x, s)
|
||||||
|
for i := n + 1; i < len(a); i++ {
|
||||||
|
if a[i] == s {
|
||||||
|
a[i] = ""
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return x
|
return x
|
||||||
|
|
Loading…
Reference in New Issue