diff --git a/upbc/protoc-gen-upb.cc b/upbc/protoc-gen-upb.cc index 2ced805c4c..d3291a3cd4 100644 --- a/upbc/protoc-gen-upb.cc +++ b/upbc/protoc-gen-upb.cc @@ -108,6 +108,7 @@ void AddEnums(const protobuf::Descriptor* message, std::vector SortedEnums( const protobuf::FileDescriptor* file) { std::vector enums; + enums.reserve(file->enum_type_count()); for (int i = 0; i < file->enum_type_count(); i++) { enums.push_back(file->enum_type(i)); }