sgilmore10 commented on code in PR #36485:
URL: https://github.com/apache/arrow/pull/36485#discussion_r1253807966


##########
matlab/src/cpp/arrow/matlab/array/proxy/timestamp_array.cc:
##########
@@ -49,7 +49,8 @@ namespace arrow::matlab::array::proxy {
         const mda::TypedArray<mda::MATLABString> units_mda = 
opts[0]["TimeUnit"];
 
         // extract the time zone string
-        MATLAB_ASSIGN_OR_ERROR(const auto timezone, 
arrow::util::UTF16StringToUTF8(timezone_mda[0]),
+        const std::u16string u16_timezone = timezone_mda[0];

Review Comment:
   Hi @kou, this does cause a copy. Unfortunately, it's not  possible to create 
a `std::816string_view` from `timezone_mda` directly. However, I can extract a 
`const` reference from `timezone_mda:
   
   ```cpp
   const std::u16string& u16_timezone = timezone_mda[0];
   ```
   
   That should avoid the copy.



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