Skip to content

Commit

Permalink
perf(common-util): Change StringBuffer to StringBuilder
Browse files Browse the repository at this point in the history
  • Loading branch information
msavy committed Jun 13, 2017
1 parent dc1924d commit ac3a038
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
Expand Up @@ -43,14 +43,14 @@ public static String trim(String string) {
* Join together varargs using a join sequence.
* <p>
* <tt>join("-", a, b, c) => a-b-c</tt>
*
*
* @param joinChar character to join string
* @param args strings to join
* @return joined string
*/
public static String join(String joinChar, String... args) {
String next = ""; //$NON-NLS-1$
StringBuffer result = new StringBuffer(length(args) + (args.length - 1));
StringBuilder result = new StringBuilder(length(args) + (args.length - 1));

for (String arg : args) {
result.append(next);
Expand Down
Expand Up @@ -378,7 +378,7 @@ private String getPrefferedCipher() throws Exception {

server.start();

final StringBuffer sbuff = new StringBuffer();
final StringBuilder sbuff = new StringBuilder();
final CountDownLatch latch = new CountDownLatch(1);

HttpConnectorFactory factory = new HttpConnectorFactory(config);
Expand Down
Expand Up @@ -108,7 +108,7 @@ public static EchoResponse response(HttpServletRequest request, boolean withBody
};

byte[] hashBytes = sha1.digest();
StringBuffer sb = new StringBuffer();
StringBuilder sb = new StringBuilder();
for (int i = 0; i < hashBytes.length; i++) {
sb.append(Integer.toString((hashBytes[i] & 0xff) + 0x100, 16).substring(1));
}
Expand All @@ -130,7 +130,7 @@ public static EchoResponse response(HttpServletRequest request, boolean withBody
*/
public EchoServlet() {
}

/**
* @see javax.servlet.http.HttpServlet#service(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
*/
Expand Down

0 comments on commit ac3a038

Please sign in to comment.