Skip to content
Snippets Groups Projects
Unverified Commit b8042168 authored by WangLiang/王良's avatar WangLiang/王良 Committed by GitHub
Browse files

optimize: replace StringBuffer to StringBuilder (#3313)

parent 709c43f4
No related branches found
No related tags found
No related merge requests found
......@@ -31,7 +31,7 @@ public class MockResponse {
}
public String write(String content) throws IOException {
StringBuffer httpResponse = new StringBuffer();
StringBuilder httpResponse = new StringBuilder();
httpResponse.append("HTTP/1.1 200 OK\n")
.append("Content-Type:application/json\n")
.append("\r\n")
......
......@@ -170,7 +170,7 @@ public abstract class BaseTransactionalExecutor<T, S extends Statement> implemen
if (Objects.isNull(columnNameList) || columnNameList.isEmpty()) {
return null;
}
StringBuffer columnNamesStr = new StringBuffer();
StringBuilder columnNamesStr = new StringBuilder();
for (int i = 0; i < columnNameList.size(); i++) {
if (i > 0) {
columnNamesStr.append(" , ");
......
......@@ -32,11 +32,11 @@ public class SpringJvmUUIDSeqGenerator implements SeqGenerator {
@Override
public String generate(String entity, String ruleName, List<Object> shardingParameters) {
String uuid = idGenerator.generateId().toString();
StringBuffer buf = new StringBuffer(uuid.length() - 4);
StringBuilder sb = new StringBuilder(uuid.length() - 4);
for (String seg : uuid.split("-")) {
buf.append(seg);
sb.append(seg);
}
return buf.toString();
return sb.toString();
}
@Override
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment