提交 34d73467 authored 作者: Evgenij Ryazanov's avatar Evgenij Ryazanov

Reuse StringBuilder in TestScript

上级 ce00245a
...@@ -280,7 +280,7 @@ public class TestScript extends TestDb { ...@@ -280,7 +280,7 @@ public class TestScript extends TestDb {
write(sql); write(sql);
buff.append(sql, 0, sql.length() - 1); buff.append(sql, 0, sql.length() - 1);
sql = buff.toString(); sql = buff.toString();
buff = new StringBuilder(); buff.setLength(0);
process(sql, allowReconnect); process(sql, allowReconnect);
} else { } else {
write(sql); write(sql);
...@@ -365,7 +365,7 @@ public class TestScript extends TestDb { ...@@ -365,7 +365,7 @@ public class TestScript extends TestDb {
char c = param.charAt(i); char c = param.charAt(i);
if (c == ',') { if (c == ',') {
setParameter(prep, ++index, buff.toString()); setParameter(prep, ++index, buff.toString());
buff = new StringBuilder(); buff.setLength(0);
} else if (c == '"') { } else if (c == '"') {
while (true) { while (true) {
c = param.charAt(++i); c = param.charAt(++i);
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论