From 8f8be3122622745929bd634e920559e453920426 Mon Sep 17 00:00:00 2001 From: Nikolay Fedorovskikh Date: Thu, 22 Jun 2017 00:42:01 +0500 Subject: [PATCH] Remove unnecessary conversions Motivation: In a `HttpConversionUtil#toHttp2Headers` a status code conversion can be replaced with using `HttpResponseStatus#codeAsText` method. Modifications: Apply `HttpResponseStatus#codeAsText` method. Result: Less allocations. --- .../java/io/netty/handler/codec/http2/HttpConversionUtil.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/codec-http2/src/main/java/io/netty/handler/codec/http2/HttpConversionUtil.java b/codec-http2/src/main/java/io/netty/handler/codec/http2/HttpConversionUtil.java index 76526015cf..0f23ab6f8d 100644 --- a/codec-http2/src/main/java/io/netty/handler/codec/http2/HttpConversionUtil.java +++ b/codec-http2/src/main/java/io/netty/handler/codec/http2/HttpConversionUtil.java @@ -361,7 +361,7 @@ public final class HttpConversionUtil { } } else if (in instanceof HttpResponse) { HttpResponse response = (HttpResponse) in; - out.status(new AsciiString(Integer.toString(response.status().code()))); + out.status(response.status().codeAsText()); } // Add the HTTP headers which have not been consumed above