gleono commented on code in PR #92:
URL: 
https://github.com/apache/openwhisk-runtime-dotnet/pull/92#discussion_r1796206678


##########
core/net6.0/proxy/Apache.OpenWhisk.Runtime.Common/HttpResponseExtension.cs:
##########
@@ -27,15 +27,14 @@ public static class HttpResponseExtension
     {
         public static async Task WriteResponse(this HttpResponse response, int 
code, string content)
         {
-            byte[] bytes = Encoding.UTF8.GetBytes(content);
-            response.ContentLength = bytes.Length;
+            response.ContentLength = Encoding.UTF8.GetByteCount(content);

Review Comment:
   No need to allocate an array to count the number of bytes.



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to