don't change index's columns sort in Equal
This commit is contained in:
parent
b8d39bd0ff
commit
6bc9412b1c
12
index.go
12
index.go
|
@ -2,7 +2,6 @@ package core
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"sort"
|
|
||||||
"strings"
|
"strings"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -46,11 +45,16 @@ func (index *Index) Equal(dst *Index) bool {
|
||||||
if len(index.Cols) != len(dst.Cols) {
|
if len(index.Cols) != len(dst.Cols) {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
sort.StringSlice(index.Cols).Sort()
|
|
||||||
sort.StringSlice(dst.Cols).Sort()
|
|
||||||
|
|
||||||
for i := 0; i < len(index.Cols); i++ {
|
for i := 0; i < len(index.Cols); i++ {
|
||||||
if index.Cols[i] != dst.Cols[i] {
|
var found bool
|
||||||
|
for j := 0; j < len(dst.Cols); j++ {
|
||||||
|
if index.Cols[i] == dst.Cols[j] {
|
||||||
|
found = true
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if !found {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue