Address requested change from code review.

pull/599/head
Jon Skeet 10 years ago
parent 541b442b99
commit db52c9dd58
  1. 24
      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++) { for (int i = 0; i < descriptor_->nested_type_count(); i++) {
// Don't generate accessor table fields for maps... // Don't generate accessor table fields for maps...
if (IsMapEntryMessage(descriptor_->nested_type(i))) continue; if (!IsMapEntryMessage(descriptor_->nested_type(i))) {
MessageGenerator messageGenerator(descriptor_->nested_type(i));
MessageGenerator messageGenerator(descriptor_->nested_type(i)); messageGenerator.GenerateStaticVariables(printer);
messageGenerator.GenerateStaticVariables(printer); }
} }
} }
@ -164,10 +164,10 @@ void MessageGenerator::GenerateStaticVariableInitializers(io::Printer* printer)
// Generate static member initializers for all non-map-entry nested types. // Generate static member initializers for all non-map-entry nested types.
for (int i = 0; i < descriptor_->nested_type_count(); i++) { for (int i = 0; i < descriptor_->nested_type_count(); i++) {
if (IsMapEntryMessage(descriptor_->nested_type(i))) continue; if (!IsMapEntryMessage(descriptor_->nested_type(i))) {
MessageGenerator messageGenerator(descriptor_->nested_type(i));
MessageGenerator messageGenerator(descriptor_->nested_type(i)); messageGenerator.GenerateStaticVariableInitializers(printer);
messageGenerator.GenerateStaticVariableInitializers(printer); }
} }
} }
@ -302,10 +302,10 @@ void MessageGenerator::Generate(io::Printer* printer) {
} }
for (int i = 0; i < descriptor_->nested_type_count(); i++) { for (int i = 0; i < descriptor_->nested_type_count(); i++) {
// Don't generate nested types for maps... // Don't generate nested types for maps...
if (IsMapEntryMessage(descriptor_->nested_type(i))) continue; if (!IsMapEntryMessage(descriptor_->nested_type(i))) {
MessageGenerator messageGenerator(descriptor_->nested_type(i));
MessageGenerator messageGenerator(descriptor_->nested_type(i)); messageGenerator.Generate(printer);
messageGenerator.Generate(printer); }
} }
printer->Outdent(); printer->Outdent();
printer->Print("}\n" printer->Print("}\n"

Loading…
Cancel
Save