diff options
author | Bruno de Oliveira Abinader <bruno@mapbox.com> | 2017-06-28 17:39:49 +0300 |
---|---|---|
committer | Bruno de Oliveira Abinader <bruno@mapbox.com> | 2017-06-28 18:20:45 +0300 |
commit | 5a03ae3d906336536ee493426d6cdcc3129c155d (patch) | |
tree | 8083c4a5dfd1c743db6c73d0e14434c06390d16a /src/mbgl/gl/index_buffer.hpp | |
parent | a35b268606b6becf218286036e4d1cfc22ddcaa3 (diff) | |
download | qtlocation-mapboxgl-upstream/index-vertex-vector-reserve.tar.gz |
[core] Reserve space for index/vertex items when possibleupstream/index-vertex-vector-reserve
Diffstat (limited to 'src/mbgl/gl/index_buffer.hpp')
-rw-r--r-- | src/mbgl/gl/index_buffer.hpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/mbgl/gl/index_buffer.hpp b/src/mbgl/gl/index_buffer.hpp index 1e57fb11f2..7ba888444a 100644 --- a/src/mbgl/gl/index_buffer.hpp +++ b/src/mbgl/gl/index_buffer.hpp @@ -14,6 +14,10 @@ class IndexVector { public: static constexpr std::size_t groupSize = DrawMode::bufferGroupSize; + void reserve(std::size_t size) { + v.reserve(size); + } + template <class... Args> void emplace_back(Args&&... args) { static_assert(sizeof...(args) == groupSize, "wrong buffer element count"); |