CurtHagenlocher commented on code in PR #331:
URL: https://github.com/apache/arrow-dotnet/pull/331#discussion_r3142955597
##########
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:
Instead of using `stackalloc`, why not just grow the underlying buffer by
`byteCount` and `GetBytes` straight into the destination buffer?
--
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]