mirror of
https://github.com/i2p/i2p.i2p.git
synced 2026-10-23 13:03:04 +00:00
Console: Improve writing efficiency
replace out.write(buf.toString) with out.append(buf) to eliminate extra copy and object churn
This commit is contained in:
15 files changed
+30
-30
No files matched your search
@@ -908,7 +908,7 @@ public class I2PSnarkServlet extends BasicServlet {
|
||||
private void writeHiddenInputs(PrintWriter out, HttpServletRequest req, String action) {
|
||||
StringBuilder buf = new StringBuilder(256);
|
||||
writeHiddenInputs(buf, req, action);
|
||||
out.write(buf.toString());
|
||||
out.append(buf);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1995,7 +1995,7 @@ public class I2PSnarkServlet extends BasicServlet {
|
||||
buf.append("<a href=\"").append(encodedBaseName)
|
||||
.append("/\" title=\"").append(_t("Torrent details"))
|
||||
.append("\">");
|
||||
out.write(buf.toString());
|
||||
out.append(buf);
|
||||
}
|
||||
String icon;
|
||||
if (isMultiFile)
|
||||
@@ -2024,7 +2024,7 @@ public class I2PSnarkServlet extends BasicServlet {
|
||||
.append("\">");
|
||||
toThemeImg(buf, "comment", "", "");
|
||||
buf.append("</a>");
|
||||
out.write(buf.toString());
|
||||
out.append(buf);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2048,7 +2048,7 @@ public class I2PSnarkServlet extends BasicServlet {
|
||||
else
|
||||
buf.append(_t("Open file"));
|
||||
buf.append("\">");
|
||||
out.write(buf.toString());
|
||||
out.append(buf);
|
||||
}
|
||||
out.write(DataHelper.escapeHTML(basename));
|
||||
if (remaining == 0 || isMultiFile)
|
||||
@@ -3048,7 +3048,7 @@ public class I2PSnarkServlet extends BasicServlet {
|
||||
"</td></tr>" +
|
||||
"<tr class=\"spacer\"><td colspan=\"7\"> </td></tr>\n" + // spacer
|
||||
"</table></div></div></form>\n");
|
||||
out.write(buf.toString());
|
||||
out.append(buf);
|
||||
}
|
||||
|
||||
private void writeConfigLink(PrintWriter out) throws IOException {
|
||||
|
||||
Reference in new issue
Block a user