Skip to content

Commit

Permalink
fix duplkicated declaration
Browse files Browse the repository at this point in the history
  • Loading branch information
zhexuany committed Jun 26, 2017
1 parent c4e175e commit bd0aed2
Showing 1 changed file with 0 additions and 39 deletions.
39 changes: 0 additions & 39 deletions plan/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -410,42 +410,3 @@ func supportExpr(exprType tipb.ExprType) bool {
return false
}
}

type VisitInfoArray []visitInfo

func (v VisitInfoArray) Len() int {
return len(v)
}

func (v VisitInfoArray) Less(i, j int) bool {
if v[i].privilege < v[j].privilege {
return true
}
if v[i].db < v[j].db {
return true
}
if v[i].table < v[j].table {
return true
}
if v[i].column < v[j].column {
return true
}

return false
}

func (v VisitInfoArray) Swap(i, j int) {
v[i], v[j] = v[j], v[i]
}

func unique(v []visitInfo) []visitInfo {
repeat := 0
for i := 1; i < len(v); i++ {
if v[i] == v[i-1] {
repeat++
} else {
v[i-repeat] = v[i]
}
}
return v[:len(v)-repeat]
}

0 comments on commit bd0aed2

Please sign in to comment.