String concatenation cleanup Replaced string concatenation in loop with StringBuilder
Signed-off-by: Laszlo Hornyak <[email protected]> Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/74a3cb4d Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/74a3cb4d Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/74a3cb4d Branch: refs/heads/master Commit: 74a3cb4d5ec2c4919eef531a2b0d5986b975bee3 Parents: 8e3ae40 Author: Laszlo Hornyak <[email protected]> Authored: Sun Feb 9 19:01:45 2014 +0100 Committer: Laszlo Hornyak <[email protected]> Committed: Sun Feb 9 19:01:45 2014 +0100 ---------------------------------------------------------------------- .../kvm/src/org/apache/cloudstack/utils/qemu/QemuImg.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cloudstack/blob/74a3cb4d/plugins/hypervisors/kvm/src/org/apache/cloudstack/utils/qemu/QemuImg.java ---------------------------------------------------------------------- diff --git a/plugins/hypervisors/kvm/src/org/apache/cloudstack/utils/qemu/QemuImg.java b/plugins/hypervisors/kvm/src/org/apache/cloudstack/utils/qemu/QemuImg.java index a948ca1..b380815 100644 --- a/plugins/hypervisors/kvm/src/org/apache/cloudstack/utils/qemu/QemuImg.java +++ b/plugins/hypervisors/kvm/src/org/apache/cloudstack/utils/qemu/QemuImg.java @@ -90,11 +90,11 @@ public class QemuImg { if (options != null && !options.isEmpty()) { s.add("-o"); - String optionsStr = ""; + final StringBuilder optionsStr = new StringBuilder(); for (Map.Entry<String, String> option : options.entrySet()) { - optionsStr += option.getKey() + "=" + option.getValue() + ","; + optionsStr.append(option.getKey()).append('=').append(option.getValue()).append(','); } - s.add(optionsStr); + s.add(optionsStr.toString()); } /*
