diff --git a/ortools/util/parse_proto.cc b/ortools/util/parse_proto.cc index d9a780ec83..3da0bc094f 100644 --- a/ortools/util/parse_proto.cc +++ b/ortools/util/parse_proto.cc @@ -37,11 +37,10 @@ class TextFormatErrorCollector : public google::protobuf::io::ErrorCollector { ~TextFormatErrorCollector() override = default; void AddError(int line, int column, const std::string& message) override { - collected_errors_.push_back({false, line, column, std::string(message)}); + collected_errors_.push_back({false, line, column, message}); } - void AddWarning(const int line, const int column, - absl::string_view message) override { - collected_errors_.push_back({true, line, column, std::string(message)}); + void AddWarning(int line, int column, const std::string& message) override { + collected_errors_.push_back({true, line, column, message}); } // Returns a string listing each collected error. When an error is associated