Skip to content

Commit

Permalink
avoid allocation for legacy servers (#1891)
Browse files Browse the repository at this point in the history
  • Loading branch information
SylvainJuge authored Jun 30, 2021
1 parent 369598c commit 48d697e
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -1184,7 +1184,12 @@ private void serializeUrl(final Url url) {
writeField("port", port);
} else {
// serialize as a string for compatibility
writeField("port", Integer.toString(port));
// doing it in low-level to avoid allocation
writeFieldName("port", jw);
jw.writeByte(QUOTE);
NumberConverter.serialize(port, jw);
jw.writeByte(QUOTE);
jw.writeByte(COMMA);
}
writeField("pathname", url.getPathname());
writeField("search", url.getSearch());
Expand Down

0 comments on commit 48d697e

Please sign in to comment.