mirror of
https://github.com/chillzhuang/blade-tool
synced 2024-12-12 12:19:27 +08:00
✨ 代码优化
This commit is contained in:
parent
0bb1832964
commit
10e7baa995
@ -40,7 +40,7 @@ public class TemplateUtil {
|
||||
*/
|
||||
public static String process(String template, Kv params) {
|
||||
Matcher matcher = pattern.matcher(template);
|
||||
StringBuffer sb = new StringBuffer();
|
||||
StringBuilder sb = new StringBuilder();
|
||||
while (matcher.find()) {
|
||||
String key = matcher.group(1) != null ? matcher.group(1) : matcher.group(2);
|
||||
String replacement = params.getStr(key);
|
||||
@ -62,7 +62,7 @@ public class TemplateUtil {
|
||||
*/
|
||||
public static String safeProcess(String template, Kv params) {
|
||||
Matcher matcher = pattern.matcher(template);
|
||||
StringBuffer sb = new StringBuffer();
|
||||
StringBuilder sb = new StringBuilder();
|
||||
while (matcher.find()) {
|
||||
String key = matcher.group(1) != null ? matcher.group(1) : matcher.group(2);
|
||||
String replacement = params.getStr(key);
|
||||
|
Loading…
Reference in New Issue
Block a user