Skip to content

Commit

Permalink
Merge pull request square#917 from square/jw/char
Browse files Browse the repository at this point in the history
Use a character for appending spaces to skip array-based copy path.
  • Loading branch information
swankjesse committed Jun 11, 2014
2 parents a889f71 + 3469c11 commit 2938800
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@ private RequestLine() {
static String get(Request request, Proxy.Type proxyType, Protocol protocol) {
StringBuilder result = new StringBuilder();
result.append(request.method());
result.append(" ");
result.append(' ');

if (includeAuthorityInRequestLine(request, proxyType)) {
result.append(request.url());
} else {
result.append(requestPath(request.url()));
}

result.append(" ");
result.append(' ');
result.append(version(protocol));
return result.toString();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,9 @@ public static StatusLine parse(String statusLine) throws IOException {
@Override public String toString() {
StringBuilder result = new StringBuilder();
result.append(protocol == Protocol.HTTP_1_0 ? "HTTP/1.0" : "HTTP/1.1");
result.append(" ").append(code);
result.append(' ').append(code);
if (message != null) {
result.append(" ").append(message);
result.append(' ').append(message);
}
return result.toString();
}
Expand Down

0 comments on commit 2938800

Please sign in to comment.