Merge pull request #554 from haberman:push_back

PiperOrigin-RevId: 435158445
pull/13171/head
Copybara-Service 3 years ago
commit 8bc976b951
  1. 1
      upbc/protoc-gen-upb.cc

@ -108,6 +108,7 @@ void AddEnums(const protobuf::Descriptor* message,
std::vector<const protobuf::EnumDescriptor*> SortedEnums( std::vector<const protobuf::EnumDescriptor*> SortedEnums(
const protobuf::FileDescriptor* file) { const protobuf::FileDescriptor* file) {
std::vector<const protobuf::EnumDescriptor*> enums; std::vector<const protobuf::EnumDescriptor*> enums;
enums.reserve(file->enum_type_count());
for (int i = 0; i < file->enum_type_count(); i++) { for (int i = 0; i < file->enum_type_count(); i++) {
enums.push_back(file->enum_type(i)); enums.push_back(file->enum_type(i));
} }

Loading…
Cancel
Save