Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions src/google/protobuf/text_format.cc
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,7 @@ class TextFormat::Parser::ParserImpl {
}
ParserImpl(const ParserImpl&) = delete;
ParserImpl& operator=(const ParserImpl&) = delete;
~ParserImpl() {}
~ParserImpl() = default;

// Parses the ASCII representation specified in input and saves the
// information into the output pointer (a Message). Returns
Expand Down Expand Up @@ -1369,7 +1369,7 @@ class TextFormat::Parser::ParserImpl {

ParserErrorCollector(const ParserErrorCollector&) = delete;
ParserErrorCollector& operator=(const ParserErrorCollector&) = delete;
~ParserErrorCollector() override {}
~ParserErrorCollector() override = default;

void RecordError(int line, int column, absl::string_view message) override {
parser_->ReportError(line, column, message);
Expand Down Expand Up @@ -1714,7 +1714,7 @@ class TextFormat::Printer::FastFieldValuePrinterUtf8Escaping

// ===========================================================================
// Implementation of the default Finder for extensions.
TextFormat::Finder::~Finder() {}
TextFormat::Finder::~Finder() = default;

const FieldDescriptor* TextFormat::Finder::FindExtension(
Message* message, const std::string& name) const {
Expand Down Expand Up @@ -1753,7 +1753,7 @@ TextFormat::Parser::Parser()
allow_singular_overwrites_(false),
recursion_limit_(std::numeric_limits<int>::max()) {}

TextFormat::Parser::~Parser() {}
TextFormat::Parser::~Parser() = default;

namespace {

Expand Down Expand Up @@ -1879,7 +1879,7 @@ bool TextFormat::Parser::ParseFieldValueFromString(absl::string_view input,

// ===========================================================================

TextFormat::BaseTextGenerator::~BaseTextGenerator() {}
TextFormat::BaseTextGenerator::~BaseTextGenerator() = default;

namespace {

Expand All @@ -1901,7 +1901,7 @@ class StringBaseTextGenerator : public TextFormat::BaseTextGenerator {
// The default implementation for FieldValuePrinter. We just delegate the
// implementation to the default FastFieldValuePrinter to avoid duplicating the
// logic.
TextFormat::FieldValuePrinter::FieldValuePrinter() {}
TextFormat::FieldValuePrinter::FieldValuePrinter() = default;
TextFormat::FieldValuePrinter::~FieldValuePrinter() {}

#define FORWARD_IMPL(fn, ...) \
Expand Down Expand Up @@ -1961,8 +1961,8 @@ std::string TextFormat::FieldValuePrinter::PrintMessageEnd(
}
#undef FORWARD_IMPL

TextFormat::FastFieldValuePrinter::FastFieldValuePrinter() {}
TextFormat::FastFieldValuePrinter::~FastFieldValuePrinter() {}
TextFormat::FastFieldValuePrinter::FastFieldValuePrinter() = default;
TextFormat::FastFieldValuePrinter::~FastFieldValuePrinter() = default;
void TextFormat::FastFieldValuePrinter::PrintBool(
bool val, BaseTextGenerator* generator) const {
if (val) {
Expand Down Expand Up @@ -2182,8 +2182,8 @@ bool TextFormat::Printer::RegisterFieldValuePrinter(
if (field == nullptr || printer == nullptr) {
return false;
}
std::unique_ptr<FieldValuePrinterWrapper> wrapper(
new FieldValuePrinterWrapper(nullptr));
std::unique_ptr<FieldValuePrinterWrapper> wrapper =
std::make_unique<FieldValuePrinterWrapper>(nullptr);
auto pair = custom_printers_.emplace(field, nullptr);
if (pair.second) {
wrapper->SetDelegate(printer);
Expand Down
Loading