[tor-commits] [metrics-web/master] Use 'StringBuilder#append' consistently.

karsten at torproject.org karsten at torproject.org
Wed Mar 28 15:22:31 UTC 2018


commit 03fc04edbd31490dcb1c31499c6ddce12a214328
Author: iwakeh <iwakeh at torproject.org>
Date:   Sat Mar 24 09:31:07 2018 +0000

    Use 'StringBuilder#append' consistently.
---
 .../java/org/torproject/metrics/web/RObjectGenerator.java  | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/src/main/java/org/torproject/metrics/web/RObjectGenerator.java b/src/main/java/org/torproject/metrics/web/RObjectGenerator.java
index 5d9b29c..04bda0c 100644
--- a/src/main/java/org/torproject/metrics/web/RObjectGenerator.java
+++ b/src/main/java/org/torproject/metrics/web/RObjectGenerator.java
@@ -188,18 +188,18 @@ public class RObjectGenerator implements ServletContextListener {
       String parameterName = parameter.getKey();
       String[] parameterValues = parameter.getValue();
       for (String param : parameterValues) {
-        tableFilenameBuilder.append("-" + param);
+        tableFilenameBuilder.append("-").append(param);
       }
       if (parameterValues.length < 2) {
-        queryBuilder.append(parameterName + " = '"
-            + parameterValues[0] + "', ");
+        queryBuilder.append(parameterName).append(" = '")
+            .append(parameterValues[0]).append("', ");
       } else {
-        queryBuilder.append(parameterName + " = c(");
+        queryBuilder.append(parameterName).append(" = c(");
         for (int i = 0; i < parameterValues.length - 1; i++) {
-          queryBuilder.append("'" + parameterValues[i] + "', ");
+          queryBuilder.append("'").append(parameterValues[i]).append("', ");
         }
-        queryBuilder.append("'" + parameterValues[
-            parameterValues.length - 1] + "'), ");
+        queryBuilder.append("'").append(parameterValues[
+            parameterValues.length - 1]).append("'), ");
       }
     }
     tableFilenameBuilder.append(".tbl");





More information about the tor-commits mailing list