Author: borges
Date: 2012-01-09 06:16:50 -0500 (Mon, 09 Jan 2012)
New Revision: 11998
Modified:
trunk/hornetq-commons/src/main/java/org/hornetq/utils/UUIDGenerator.java
Log:
Inefficient String append --> StringBuilder()
Modified: trunk/hornetq-commons/src/main/java/org/hornetq/utils/UUIDGenerator.java
===================================================================
--- trunk/hornetq-commons/src/main/java/org/hornetq/utils/UUIDGenerator.java 2012-01-09
09:04:19 UTC (rev 11997)
+++ trunk/hornetq-commons/src/main/java/org/hornetq/utils/UUIDGenerator.java 2012-01-09
11:16:50 UTC (rev 11998)
@@ -282,12 +282,13 @@
return null;
}
- String s = "";
+ StringBuilder s = new StringBuilder();
for (int i = 0; i < bytes.length - 1; i++)
{
- s += Integer.toHexString(bytes[i]) + ":";
+ s.append(Integer.toHexString(bytes[i]));
+ s.append(":");
}
- s += bytes[bytes.length - 1];
- return s;
+ s.append(bytes[bytes.length - 1]);
+ return s.toString();
}
}
\ No newline at end of file
Show replies by date