diff options
author | Martin Fietz <martin.fietz@gmail.com> | 2018-01-14 18:01:31 +0100 |
---|---|---|
committer | Martin Fietz <martin.fietz@gmail.com> | 2018-01-14 18:01:31 +0100 |
commit | 919ee63c3c2cc68ca4a3d63b6f314f472f2e6e78 (patch) | |
tree | 8be133308a14eb525d537ae2084248ddc6850a90 /app/src/androidTest/java/de/test/antennapod/util | |
parent | e44a54c965f70bd47c03111bd09a28c878efc7ba (diff) | |
download | AntennaPod-919ee63c3c2cc68ca4a3d63b6f314f472f2e6e78.zip |
Use StringBuilder for string concatenation in loop
Diffstat (limited to 'app/src/androidTest/java/de/test/antennapod/util')
-rw-r--r-- | app/src/androidTest/java/de/test/antennapod/util/service/download/NanoHTTPD.java | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/app/src/androidTest/java/de/test/antennapod/util/service/download/NanoHTTPD.java b/app/src/androidTest/java/de/test/antennapod/util/service/download/NanoHTTPD.java index ee393933e..4c8fa0e60 100644 --- a/app/src/androidTest/java/de/test/antennapod/util/service/download/NanoHTTPD.java +++ b/app/src/androidTest/java/de/test/antennapod/util/service/download/NanoHTTPD.java @@ -1136,16 +1136,16 @@ public abstract class NanoHTTPD { String pname = disposition.get("name"); pname = pname.substring(1, pname.length() - 1); - String value = ""; + StringBuilder value = new StringBuilder(); if (item.get("content-type") == null) { while (mpline != null && !mpline.contains(boundary)) { mpline = in.readLine(); if (mpline != null) { int d = mpline.indexOf(boundary); if (d == -1) { - value += mpline; + value.append(mpline); } else { - value += mpline.substring(0, d - 2); + value.append(mpline.substring(0, d - 2)); } } } @@ -1156,13 +1156,13 @@ public abstract class NanoHTTPD { int offset = stripMultipartHeaders(fbuf, bpositions[boundarycount - 2]); String path = saveTmpFile(fbuf, offset, bpositions[boundarycount - 1] - offset - 4); files.put(pname, path); - value = disposition.get("filename"); - value = value.substring(1, value.length() - 1); + value = new StringBuilder(disposition.get("filename")); + value = new StringBuilder(value.substring(1, value.length() - 1)); do { mpline = in.readLine(); } while (mpline != null && !mpline.contains(boundary)); } - parms.put(pname, value); + parms.put(pname, value.toString()); } } } catch (IOException ioe) { |