You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by bm...@apache.org on 2018/09/15 20:46:47 UTC

[mesos] 02/02: Reserved capacity when evolving repeated fields.

This is an automated email from the ASF dual-hosted git repository.

bmahler pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mesos.git

commit 4805a47c689a6aa8bdc184e64517f77d210f5611
Author: Benjamin Mahler <bm...@apache.org>
AuthorDate: Sat Sep 15 13:29:48 2018 -0700

    Reserved capacity when evolving repeated fields.
---
 src/internal/evolve.hpp | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/internal/evolve.hpp b/src/internal/evolve.hpp
index 1da6ec8..1044d9d 100644
--- a/src/internal/evolve.hpp
+++ b/src/internal/evolve.hpp
@@ -105,6 +105,7 @@ google::protobuf::RepeatedPtrField<T1> evolve(
     const google::protobuf::RepeatedPtrField<T2>& t2s)
 {
   google::protobuf::RepeatedPtrField<T1> t1s;
+  t1s.Reserve(t2s.size());
 
   foreach (const T2& t2, t2s) {
     *t1s.Add() = evolve(t2);