InCerryGit commented on code in PR #331:
URL: https://github.com/apache/arrow-dotnet/pull/331#discussion_r3143012732


##########
src/Apache.Arrow/Arrays/StringArray.cs:
##########
@@ -43,13 +45,54 @@ public Builder Append(string value, Encoding encoding = 
null)
                 {
                     return AppendNull();
                 }
+
                 encoding = encoding ?? DefaultEncoding;
-                byte[] span = encoding.GetBytes(value);
-                return Append(span.AsSpan());
+
+                int byteCount = encoding.GetByteCount(value);

Review Comment:
   Updated to encode directly into the reserved ValueBuffer span instead of 
using stackalloc, then resized after encoding succeeds. Thanks.



-- 
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