Skip to content

Commit

Permalink
Avoid creating an unnecessary temporary string value when creating AR…
Browse files Browse the repository at this point in the history
…ROW_TABULAR_SCHEMA_UNKNOWN_FIELD_NAME error message.

Co-authored-by: Sutou Kouhei <[email protected]>
  • Loading branch information
kevingurney and kou authored Aug 4, 2023
1 parent 50e24cb commit 07ec30c
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions matlab/src/cpp/arrow/matlab/tabular/proxy/schema.cc
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,11 @@ namespace arrow::matlab::tabular::proxy {

libmexclass::error::Error makeUnknownFieldNameError(const std::string& name) {
using namespace libmexclass::error;
const std::string error_message_id = std::string{error::ARROW_TABULAR_SCHEMA_UNKNOWN_FIELD_NAME};
std::stringstream error_message_stream;
error_message_stream << "Unknown field name: '";
error_message_stream << name;
error_message_stream << "'.";
const std::string& error_message = error_message_stream.str();
return Error{error_message_id, error_message};
return Error{error::ARROW_TABULAR_SCHEMA_UNKNOWN_FIELD_NAME, error_message_stream.str()};
}

libmexclass::error::Error makeEmptySchemaError() {
Expand Down

0 comments on commit 07ec30c

Please sign in to comment.