[libbluray-devel] Use StringBuffer

hpi1 git at videolan.org
Wed May 3 15:05:57 CEST 2017


libbluray | branch: master | hpi1 <hpi1 at anonymous.org> | Mon Apr  3 12:12:37 2017 +0300| [44ca37b678af544fa96c67fc68a2746c1fc721b0] | committer: hpi1

Use StringBuffer

> http://git.videolan.org/gitweb.cgi/libbluray.git/?a=commit;h=44ca37b678af544fa96c67fc68a2746c1fc721b0
---

 src/libbluray/bdj/java/org/dvb/user/Preference.java | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)

diff --git a/src/libbluray/bdj/java/org/dvb/user/Preference.java b/src/libbluray/bdj/java/org/dvb/user/Preference.java
index e80c0029..71ae34bc 100644
--- a/src/libbluray/bdj/java/org/dvb/user/Preference.java
+++ b/src/libbluray/bdj/java/org/dvb/user/Preference.java
@@ -112,15 +112,21 @@ public class Preference {
     }
 
     public String toString() {
-        String result = "Preference:" + name + "[";
+        StringBuffer result = new StringBuffer();
         String comma = "";
+
+        result.append("Preference:");
+        result.append(name);
+        result.append("[");
+
         Iterator it = values.iterator();
         while (it.hasNext()) {
-            result += comma + (String)it.next();
+            result.append(comma);
+            result.append((String)it.next());
             comma = ",";
         }
-        result += ']';
-        return result;
+        result.append("]");
+        return result.toString();
     }
 
     private String name;



More information about the libbluray-devel mailing list