Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ else if (matchEnd >= inputLimit - 1) {
j = kmpShifts[j];

// Continue to match the whole pattern using KMP
while (j > 0) {
while (j >= 0) {
int size = findLongestMatch(input, i, pattern, j, Math.min(inputLimit - i, pattern.length - j));
i += size;
j += size;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,12 @@ public void test()

assertFalse(match("%abaaa%", "ababaa"));

assertTrue(match("%paya%", "papaya"));
assertTrue(match("%paya%", "papapaya"));
assertTrue(match("%paya%", "papapapaya"));
assertTrue(match("%paya%", "papapapapaya"));
assertTrue(match("%paya%", "papapapapapaya"));

// utf-8
LikeMatcher singleOptimized = LikePattern.compile("_", Optional.empty(), true).getMatcher();
LikeMatcher multipleOptimized = LikePattern.compile("_a%b_", Optional.empty(), true).getMatcher(); // prefix and suffix with _a and b_ to avoid optimizations
Expand Down