Skip to content

Commit

Permalink
address comments.
Browse files Browse the repository at this point in the history
  • Loading branch information
winoros committed Aug 15, 2018
1 parent 7409e6e commit c5cdc13
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions expression/column.go
Original file line number Diff line number Diff line change
Expand Up @@ -380,17 +380,15 @@ func IndexInfo2Cols(cols []*Column, index *model.IndexInfo) ([]*Column, []int) {
func FindColumnsByUniqueIDs(cols []*Column, ids []int) []*Column {
retCols := make([]*Column, 0, len(ids))
for _, id := range ids {
found := false
for _, col := range cols {
if col.UniqueID == id {
retCols = append(retCols, col)
found = true
break
}
}
if !found {
break
}
}
return retCols
if len(retCols) == len(ids) {
return retCols
}
return nil
}

0 comments on commit c5cdc13

Please sign in to comment.