From db52c9dd585da7d5c9063409117b8a5680e384db Mon Sep 17 00:00:00 2001 From: Jon Skeet Date: Wed, 15 Jul 2015 22:03:38 +0100 Subject: [PATCH] Address requested change from code review. --- .../compiler/csharp/csharp_message.cc | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/src/google/protobuf/compiler/csharp/csharp_message.cc b/src/google/protobuf/compiler/csharp/csharp_message.cc index 5a72b2e73d..79b762d184 100644 --- a/src/google/protobuf/compiler/csharp/csharp_message.cc +++ b/src/google/protobuf/compiler/csharp/csharp_message.cc @@ -122,10 +122,10 @@ void MessageGenerator::GenerateStaticVariables(io::Printer* printer) { for (int i = 0; i < descriptor_->nested_type_count(); i++) { // Don't generate accessor table fields for maps... - if (IsMapEntryMessage(descriptor_->nested_type(i))) continue; - - MessageGenerator messageGenerator(descriptor_->nested_type(i)); - messageGenerator.GenerateStaticVariables(printer); + if (!IsMapEntryMessage(descriptor_->nested_type(i))) { + MessageGenerator messageGenerator(descriptor_->nested_type(i)); + messageGenerator.GenerateStaticVariables(printer); + } } } @@ -164,10 +164,10 @@ void MessageGenerator::GenerateStaticVariableInitializers(io::Printer* printer) // Generate static member initializers for all non-map-entry nested types. for (int i = 0; i < descriptor_->nested_type_count(); i++) { - if (IsMapEntryMessage(descriptor_->nested_type(i))) continue; - - MessageGenerator messageGenerator(descriptor_->nested_type(i)); - messageGenerator.GenerateStaticVariableInitializers(printer); + if (!IsMapEntryMessage(descriptor_->nested_type(i))) { + MessageGenerator messageGenerator(descriptor_->nested_type(i)); + messageGenerator.GenerateStaticVariableInitializers(printer); + } } } @@ -302,10 +302,10 @@ void MessageGenerator::Generate(io::Printer* printer) { } for (int i = 0; i < descriptor_->nested_type_count(); i++) { // Don't generate nested types for maps... - if (IsMapEntryMessage(descriptor_->nested_type(i))) continue; - - MessageGenerator messageGenerator(descriptor_->nested_type(i)); - messageGenerator.Generate(printer); + if (!IsMapEntryMessage(descriptor_->nested_type(i))) { + MessageGenerator messageGenerator(descriptor_->nested_type(i)); + messageGenerator.Generate(printer); + } } printer->Outdent(); printer->Print("}\n"