Рефакторинг

This commit is contained in:
serega6531
2020-03-11 22:26:09 +03:00
parent 59665145b3
commit a112d55496
3 changed files with 17 additions and 23 deletions

View File

@@ -33,7 +33,7 @@ public class PatternMatcher {
private void match(Pattern pattern) {
if (pattern.getSearchType() == PatternSearchType.REGEX) {
final java.util.regex.Pattern regex = compilePattern(pattern);
final var regex = compilePattern(pattern);
final Matcher matcher = regex.matcher(content);
int startPos = 0;
@@ -99,7 +99,6 @@ public class PatternMatcher {
return a <= x && x <= b;
}
private java.util.regex.Pattern compilePattern(Pattern pattern) {
return compiledPatterns.computeIfAbsent(pattern.getValue(), java.util.regex.Pattern::compile);
}