mirror of
https://gitee.com/dromara/hutool.git
synced 2025-04-05 17:37:59 +08:00
fix code
This commit is contained in:
parent
f6ee274c65
commit
8dbeb7c90f
@ -194,13 +194,7 @@ public class PatternPool {
|
|||||||
*/
|
*/
|
||||||
public static Pattern get(String regex, int flags) {
|
public static Pattern get(String regex, int flags) {
|
||||||
final RegexWithFlag regexWithFlag = new RegexWithFlag(regex, flags);
|
final RegexWithFlag regexWithFlag = new RegexWithFlag(regex, flags);
|
||||||
|
return POOL.get(regexWithFlag, ()-> Pattern.compile(regex, flags));
|
||||||
Pattern pattern = POOL.get(regexWithFlag);
|
|
||||||
if (null == pattern) {
|
|
||||||
pattern = Pattern.compile(regex, flags);
|
|
||||||
POOL.put(regexWithFlag, pattern);
|
|
||||||
}
|
|
||||||
return pattern;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user