Skip to content

Commit

Permalink
protobuf: Replace string addition with absl::StrCat (envoyproxy#37961)
Browse files Browse the repository at this point in the history
Signed-off-by: Yury Kats <[email protected]>
  • Loading branch information
yurykats authored Jan 10, 2025
1 parent 243f1dd commit 19983ec
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion source/common/protobuf/create_reflectable_message.cc
Original file line number Diff line number Diff line change
Expand Up @@ -447,7 +447,8 @@ void loadFileDescriptors(const FileDescriptorInfo& file_descriptor_info) {

Protobuf::ReflectableMessage createReflectableMessage(const Protobuf::Message& message) {
Protobuf::ReflectableMessage reflectable_message = createDynamicMessage(getTranscoder(), message);
ASSERT(reflectable_message, "Unable to create dyanmic message for: " + message.GetTypeName());
ASSERT(reflectable_message,
absl::StrCat("Unable to create dyanmic message for: ", message.GetTypeName()));
return reflectable_message;
}

Expand Down
4 changes: 2 additions & 2 deletions source/common/protobuf/utility.cc
Original file line number Diff line number Diff line change
Expand Up @@ -943,8 +943,8 @@ absl::Status MessageUtil::loadFromFile(const std::string& path, Protobuf::Messag
loadFromJson(contents, message, validation_visitor);
}
#else
return absl::InvalidArgumentError("Unable to parse file \"" + path + "\" (type " +
message.GetTypeName() + ")");
return absl::InvalidArgumentError(
absl::StrCat("Unable to parse file \"", path, "\" (type ", message.GetTypeName(), ")"));
#endif
return absl::OkStatus();
}
Expand Down

0 comments on commit 19983ec

Please sign in to comment.