Исправлен баг с кэшем паттернов
This commit is contained in:
@@ -68,6 +68,7 @@ public class PatternMatcher {
|
|||||||
int end = searcher.search(reader) - 1;
|
int end = searcher.search(reader) - 1;
|
||||||
|
|
||||||
if (end < 0) {
|
if (end < 0) {
|
||||||
|
searcher.reset();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -90,6 +91,7 @@ public class PatternMatcher {
|
|||||||
int end = searcher.search(is) - 1;
|
int end = searcher.search(is) - 1;
|
||||||
|
|
||||||
if (end < 0) {
|
if (end < 0) {
|
||||||
|
searcher.reset();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -59,4 +59,8 @@ public class KMPByteSearcher {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void reset() {
|
||||||
|
this.lastEnd = 0;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -59,4 +59,8 @@ public class KMPStringSearcher {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void reset() {
|
||||||
|
this.lastEnd = 0;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user