Skip to content

Commit

Permalink
simplified the if condition check
Browse files Browse the repository at this point in the history
Signed-off-by: Harshit Gangal <[email protected]>
  • Loading branch information
harshit-gangal committed Dec 12, 2023
1 parent 4bf4926 commit b3b4edd
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions go/vt/vtgate/planbuilder/operators/upsert.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,11 +97,7 @@ func createUpsertOperator(ctx *plancontext.PlanningContext, ins *sqlparser.Inser
expr = row[pIdx.idx]
}
equalExpr := sqlparser.NewComparisonExpr(sqlparser.EqualOp, sqlparser.NewColName(pIdx.col.String()), expr, nil)
if whereExpr == nil {
whereExpr = equalExpr
} else {
whereExpr = sqlparser.AndExpressions(whereExpr, equalExpr)
}
whereExpr = sqlparser.AndExpressions(whereExpr, equalExpr)
}

var updExprs sqlparser.UpdateExprs
Expand Down

0 comments on commit b3b4edd

Please sign in to comment.