Skip to content

Commit

Permalink
Merge pull request protocolbuffers#554 from haberman:push_back
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 435158445
  • Loading branch information
copybara-github committed Mar 16, 2022
2 parents b0f55f0 + c6dae65 commit 8bc976b
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions upbc/protoc-gen-upb.cc
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ void AddEnums(const protobuf::Descriptor* message,
std::vector<const protobuf::EnumDescriptor*> SortedEnums(
const protobuf::FileDescriptor* file) {
std::vector<const protobuf::EnumDescriptor*> enums;
enums.reserve(file->enum_type_count());
for (int i = 0; i < file->enum_type_count(); i++) {
enums.push_back(file->enum_type(i));
}
Expand Down

0 comments on commit 8bc976b

Please sign in to comment.