Skip to content

Commit

Permalink
fix compile error
Browse files Browse the repository at this point in the history
  • Loading branch information
LiBinfeng-01 committed Dec 13, 2024
1 parent 714850f commit 0817c0f
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -327,8 +327,8 @@ public static Expression locate(StringLikeLiteral first, StringLikeLiteral secon
@ExecFunction(name = "locate")
public static Expression locate(StringLikeLiteral first, StringLikeLiteral second, IntegerLiteral third) {
int result = second.getValue().trim().indexOf(first.getValue()) + 1;
if (third.getValue() <= 0
|| !substringImpl(second.getValue(), third.getValue(), second.getValue().length()).trim().contains(first.getValue())) {
if (third.getValue() <= 0 || !substringImpl(second.getValue(), third.getValue(),
second.getValue().length()).trim().contains(first.getValue())) {
result = 0;
}
return new IntegerLiteral(result);
Expand Down

0 comments on commit 0817c0f

Please sign in to comment.