Skip to content

Commit

Permalink
Removed unrequired clone of joinTree's vars map
Browse files Browse the repository at this point in the history
Signed-off-by: Florent Poinsard <florent.poinsard@outlook.fr>
  • Loading branch information
frouioui committed Sep 15, 2021
1 parent 6260918 commit 917c344
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions go/vt/vtgate/planbuilder/jointree.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,10 @@ func (jp *joinTree) tableID() semantics.TableSet {

func (jp *joinTree) clone() queryTree {
result := &joinTree{
lhs: jp.lhs.clone(),
rhs: jp.rhs.clone(),
outer: jp.outer,
columns: jp.columns,
vars: make(map[string]int, len(jp.vars)),
}
for key, val := range jp.vars {
result.vars[key] = val
lhs: jp.lhs.clone(),
rhs: jp.rhs.clone(),
outer: jp.outer,
vars: jp.vars,
}
return result
}
Expand Down Expand Up @@ -82,9 +78,8 @@ func (jp *joinTree) pushOutputColumns(columns []*sqlparser.ColName, semTable *se

outputColumns := make([]int, len(toTheLeft))
var l, r int
originalColSize := len(jp.vars)
for i, isLeft := range toTheLeft {
outputColumns[i] = i + originalColSize
outputColumns[i] = i
if isLeft {
jp.columns = append(jp.columns, -lhsOffset[l]-1)
l++
Expand Down

0 comments on commit 917c344

Please sign in to comment.