Revert "Use StringBuilder for string concatenation in loop"
This reverts commit 919ee63c3c
.
This commit is contained in:
parent
2a792c3c75
commit
b4d8868e9d
|
@ -1136,16 +1136,16 @@ public abstract class NanoHTTPD {
|
||||||
String pname = disposition.get("name");
|
String pname = disposition.get("name");
|
||||||
pname = pname.substring(1, pname.length() - 1);
|
pname = pname.substring(1, pname.length() - 1);
|
||||||
|
|
||||||
StringBuilder value = new StringBuilder();
|
String value = "";
|
||||||
if (item.get("content-type") == null) {
|
if (item.get("content-type") == null) {
|
||||||
while (mpline != null && !mpline.contains(boundary)) {
|
while (mpline != null && !mpline.contains(boundary)) {
|
||||||
mpline = in.readLine();
|
mpline = in.readLine();
|
||||||
if (mpline != null) {
|
if (mpline != null) {
|
||||||
int d = mpline.indexOf(boundary);
|
int d = mpline.indexOf(boundary);
|
||||||
if (d == -1) {
|
if (d == -1) {
|
||||||
value.append(mpline);
|
value += mpline;
|
||||||
} else {
|
} 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]);
|
int offset = stripMultipartHeaders(fbuf, bpositions[boundarycount - 2]);
|
||||||
String path = saveTmpFile(fbuf, offset, bpositions[boundarycount - 1] - offset - 4);
|
String path = saveTmpFile(fbuf, offset, bpositions[boundarycount - 1] - offset - 4);
|
||||||
files.put(pname, path);
|
files.put(pname, path);
|
||||||
value = new StringBuilder(disposition.get("filename"));
|
value = disposition.get("filename");
|
||||||
value = new StringBuilder(value.substring(1, value.length() - 1));
|
value = value.substring(1, value.length() - 1);
|
||||||
do {
|
do {
|
||||||
mpline = in.readLine();
|
mpline = in.readLine();
|
||||||
} while (mpline != null && !mpline.contains(boundary));
|
} while (mpline != null && !mpline.contains(boundary));
|
||||||
}
|
}
|
||||||
parms.put(pname, value.toString());
|
parms.put(pname, value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (IOException ioe) {
|
} catch (IOException ioe) {
|
||||||
|
|
Loading…
Reference in New Issue