Skip to content

Commit

Permalink
clean up code
Browse files Browse the repository at this point in the history
Signed-off-by: Andres Taylor <[email protected]>
  • Loading branch information
systay committed Oct 14, 2024
1 parent 867bc95 commit 9efcf48
Showing 1 changed file with 5 additions and 14 deletions.
19 changes: 5 additions & 14 deletions go/vt/vtgate/evalengine/expr_compare.go
Original file line number Diff line number Diff line change
Expand Up @@ -597,21 +597,13 @@ func (l *LikeExpr) matchWildcard(left, right []byte, coll collations.ID) bool {

func (l *LikeExpr) eval(env *ExpressionEnv) (eval, error) {
left, err := l.Left.eval(env)
if err != nil {
return nil, err
}

if left == nil {
return nil, nil
if err != nil || left == nil {
return left, err
}

right, err := l.Right.eval(env)
if err != nil {
return nil, err
}

if right == nil {
return nil, nil
if err != nil || right == nil {
return right, err
}

var col collations.TypedCollation
Expand Down Expand Up @@ -702,7 +694,6 @@ func (expr *LikeExpr) compile(c *compiler) (ctype, error) {
})
}

c.asm.jumpDestination(skip1)
c.asm.jumpDestination(skip2)
c.asm.jumpDestination(skip1, skip2)
return ctype{Type: sqltypes.Int64, Col: collationNumeric, Flag: flagIsBoolean | flagNullable}, nil
}

0 comments on commit 9efcf48

Please sign in to comment.