Allon Mureinik has uploaded a new change for review.

Change subject: core: GuidUtils initial StringBuilder capacity
......................................................................

core: GuidUtils initial StringBuilder capacity

The StringBuilder used in writeGUIDPartToStream is known to contain 2
characters.
This patch initializes it in the correct size instead of wasting the
additional 14 bytes done by the default initialization.

Change-Id: I301b6ebce95a069968af99fed0b65ab189d4b1a2
Signed-off-by: Allon Mureinik <[email protected]>
---
M 
backend/manager/modules/utils/src/main/java/org/ovirt/engine/core/utils/GuidUtils.java
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/38/16438/1

diff --git 
a/backend/manager/modules/utils/src/main/java/org/ovirt/engine/core/utils/GuidUtils.java
 
b/backend/manager/modules/utils/src/main/java/org/ovirt/engine/core/utils/GuidUtils.java
index 027cdc0..aff5db0358 100644
--- 
a/backend/manager/modules/utils/src/main/java/org/ovirt/engine/core/utils/GuidUtils.java
+++ 
b/backend/manager/modules/utils/src/main/java/org/ovirt/engine/core/utils/GuidUtils.java
@@ -47,7 +47,7 @@
         guidPart.getChars(0, guidPart.length(), dst, 0);
         for (int counter = 0; counter < (guidPart.length()) / 2; counter++) {
             // Build a string from two characters
-            StringBuilder numberStrSB = new StringBuilder();
+            StringBuilder numberStrSB = new StringBuilder(2);
             numberStrSB.append(dst[counter * 2]);
             numberStrSB.append(dst[(counter * 2) + 1]);
             // Convert the string to byte and add write it to the stream


-- 
To view, visit http://gerrit.ovirt.org/16438
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I301b6ebce95a069968af99fed0b65ab189d4b1a2
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Allon Mureinik <[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to