diff options
author | Henning Baldersheim <balder@oath.com> | 2018-06-09 14:28:40 +0200 |
---|---|---|
committer | Henning Baldersheim <balder@oath.com> | 2018-06-12 12:25:32 +0200 |
commit | 5370573d924dc1d52908f527a263f7e13a8bcc3b (patch) | |
tree | cefba16c71bc817602db7ec9f23efc624e546a6b /staging_vespalib | |
parent | 06d3ba8c9e0edea16dafce70c13280330c4ab59f (diff) |
Use a simpler way of appending
Diffstat (limited to 'staging_vespalib')
-rw-r--r-- | staging_vespalib/src/vespa/vespalib/util/polymorphicarrays.h | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/staging_vespalib/src/vespa/vespalib/util/polymorphicarrays.h b/staging_vespalib/src/vespa/vespalib/util/polymorphicarrays.h index d76b3f09020..721a33ae7da 100644 --- a/staging_vespalib/src/vespa/vespalib/util/polymorphicarrays.h +++ b/staging_vespalib/src/vespa/vespalib/util/polymorphicarrays.h @@ -24,9 +24,8 @@ public: size_t size() const override { return _array.size(); } iterator erase(iterator it) override { _array.erase(_array.begin() + (it - this->begin())); return it; } void push_back(const B & v) override { - size_t sz(_array.size()); - _array.resize(sz + 1); - _array[sz].assign(v); + _array.emplace_back(); + _array.back().assign(v); } private: std::vector<T> _array; |