提交 dedc5069 authored 作者: Evgenij Ryazanov's avatar Evgenij Ryazanov

Inline Function.replace() and remove unneeded null checks

上级 fba8d50b
......@@ -1326,7 +1326,7 @@ public class Function extends Expression implements FunctionCall {
if (s2 == null) {
s2 = "";
}
result = ValueString.get(replace(s0, s1, s2),
result = ValueString.get(StringUtils.replaceAll(s0, s1, s2),
database.getMode().treatEmptyStringsAsNull);
}
break;
......@@ -1980,13 +1980,6 @@ public class Function extends Expression implements FunctionCall {
return s.substring(start, start + length);
}
private static String replace(String s, String replace, String with) {
if (s == null || replace == null || with == null) {
return null;
}
return StringUtils.replaceAll(s, replace, with);
}
private static String repeat(String s, int count) {
StringBuilder buff = new StringBuilder(s.length() * count);
while (count-- > 0) {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论