Skip to content

Commit

Permalink
adjust code.
Browse files Browse the repository at this point in the history
  • Loading branch information
beliefer committed Jun 28, 2019
1 parent 8992b5a commit c9d7dfe
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -180,8 +180,8 @@ case class Like(
val pattern = ctx.addMutableState(patternClass, "patternLike",
v => s"""$v = $patternClass.compile("$regexStr");""")

// We don't use nullSafeCodeGen here because we don't want to re-evaluate right again.
val eval = left.genCode(ctx)
// We don't use nullSafeCodeGen here because we don't want to re-evaluate pattern again.
val eval = input.genCode(ctx)
ev.copy(code = code"""
${eval.code}
boolean ${ev.isNull} = ${eval.isNull};
Expand All @@ -204,7 +204,7 @@ case class Like(
s"""
String $patternStr = $eval2.toString();
String $escapeStr = $eval3.toString();
$patternClass $pattern = $patternClass.compile($escapeFunc($rightStr, $escapeStr));
$patternClass $pattern = $patternClass.compile($escapeFunc($patternStr, $escapeStr));
${ev.value} = $pattern.matcher($eval1.toString()).matches();
"""
})
Expand Down

0 comments on commit c9d7dfe

Please sign in to comment.