Skip to content

Commit

Permalink
Use GetView() instead of GetString()
Browse files Browse the repository at this point in the history
  • Loading branch information
sgilmore10 committed Jul 6, 2023
1 parent 44855a6 commit 588a0f6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion matlab/src/cpp/arrow/matlab/array/proxy/string_array.cc
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ namespace arrow::matlab::array::proxy {
strings.reserve(array_length);
for (size_t i = 0; i < array_length; ++i) {
auto string_array = std::static_pointer_cast<arrow::StringArray>(array);
const auto& str_utf8 = string_array->GetString(i);
auto str_utf8 = string_array->GetView(i);
MATLAB_ASSIGN_OR_ERROR_WITH_CONTEXT(auto str_utf16, arrow::util::UTF8StringToUTF16(str_utf8), context, error::UNICODE_CONVERSION_ERROR_ID);
const mda::MATLABString matlab_string = mda::MATLABString(std::move(str_utf16));
strings.push_back(matlab_string);
Expand Down

0 comments on commit 588a0f6

Please sign in to comment.