Revert "Use StringBuilder for string concatenation in loop"

This reverts commit 919ee63c3c.
This commit is contained in:
Martin Fietz 2018-01-21 13:13:23 +01:00
parent 2a792c3c75
commit b4d8868e9d
1 changed files with 6 additions and 6 deletions

View File

@ -1136,16 +1136,16 @@ public abstract class NanoHTTPD {
String pname = disposition.get("name");
pname = pname.substring(1, pname.length() - 1);
StringBuilder value = new StringBuilder();
String value = "";
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.append(mpline);
value += mpline;
} else {
value.append(mpline.substring(0, d - 2));
value += 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 = new StringBuilder(disposition.get("filename"));
value = new StringBuilder(value.substring(1, value.length() - 1));
value = disposition.get("filename");
value = value.substring(1, value.length() - 1);
do {
mpline = in.readLine();
} while (mpline != null && !mpline.contains(boundary));
}
parms.put(pname, value.toString());
parms.put(pname, value);
}
}
} catch (IOException ioe) {