You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "solomax (via GitHub)" <gi...@apache.org> on 2023/04/11 05:51:32 UTC
[GitHub] [wicket] solomax commented on a diff in pull request #573: WICKET-7042 Correctly size `StringResponse` when writing combined scripts
solomax commented on code in PR #573:
URL: https://github.com/apache/wicket/pull/573#discussion_r1162329834
##########
wicket-core/src/main/java/org/apache/wicket/page/PartialPageUpdate.java:
##########
@@ -265,7 +265,7 @@ private CharSequence renderScripts(Collection<CharSequence> scripts) {
combinedScript.append("(function(){").append(script).append("})();");
}
- StringResponse stringResponse = new StringResponse();
+ StringResponse stringResponse = new StringResponse(combinedScript.length() + 65);
Review Comment:
magic number? :) Should it be constant with meaningful name? :))
##########
wicket-core/src/main/java/org/apache/wicket/response/StringResponse.java:
##########
@@ -30,6 +30,8 @@
public class StringResponse extends Response
{
+ private static final int DEFAULT_INITIAL_CAPACITY = 128;
Review Comment:
I believe this one should be unified with LAzyStringResponse
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@wicket.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org