Merge pull request #2523 from jbrianceau/init-index-in-metadata
Init index_in_metadata_ without condition
This commit is contained in:
commit
f52e188fe4
@ -289,6 +289,18 @@ void FileGenerator::GenerateSource(io::Printer* printer) {
|
||||
"classname", message_generators_[i]->classname_);
|
||||
}
|
||||
|
||||
for (int i = 0; i < message_generators_.size(); i++) {
|
||||
message_generators_[i]->index_in_metadata_ = i;
|
||||
}
|
||||
for (int i = 0; i < enum_generators_.size(); i++) {
|
||||
enum_generators_[i]->index_in_metadata_ = i;
|
||||
}
|
||||
if (HasGenericServices(file_, options_)) {
|
||||
for (int i = 0; i < service_generators_.size(); i++) {
|
||||
service_generators_[i]->index_in_metadata_ = i;
|
||||
}
|
||||
}
|
||||
|
||||
if (HasDescriptorMethods(file_, options_)) {
|
||||
printer->Print(
|
||||
"\n"
|
||||
@ -313,17 +325,8 @@ void FileGenerator::GenerateSource(io::Printer* printer) {
|
||||
}
|
||||
|
||||
for (int i = 0; i < message_generators_.size(); i++) {
|
||||
message_generators_[i]->index_in_metadata_ = i;
|
||||
message_generators_[i]->GenerateDescriptorDeclarations(printer);
|
||||
}
|
||||
for (int i = 0; i < enum_generators_.size(); i++) {
|
||||
enum_generators_[i]->index_in_metadata_ = i;
|
||||
}
|
||||
if (HasGenericServices(file_, options_)) {
|
||||
for (int i = 0; i < service_generators_.size(); i++) {
|
||||
service_generators_[i]->index_in_metadata_ = i;
|
||||
}
|
||||
}
|
||||
|
||||
printer->Print(
|
||||
"\n"
|
||||
|
Loading…
Reference in New Issue
Block a user