diff options
author | Thiago Marcos P. Santos <tmpsantos@gmail.com> | 2020-03-20 12:38:09 +0200 |
---|---|---|
committer | Thiago Marcos P. Santos <tmpsantos@gmail.com> | 2020-03-23 12:09:09 +0200 |
commit | 6223fc2898949eb1228b91da26dc4a1997a83c58 (patch) | |
tree | bf1e9bf437528ae2521146507480543aa315a30f | |
parent | 5210d720ad0c94551bc9ceb6c8bd4f850f289157 (diff) | |
download | qtlocation-mapboxgl-6223fc2898949eb1228b91da26dc4a1997a83c58.tar.gz |
[core] Fix performance-inefficient-vector-operation errors
As reported by clang-tidy-8.
-rw-r--r-- | src/mbgl/renderer/render_orchestrator.cpp | 1 | ||||
-rw-r--r-- | src/mbgl/util/tile_cover.cpp | 1 |
2 files changed, 2 insertions, 0 deletions
diff --git a/src/mbgl/renderer/render_orchestrator.cpp b/src/mbgl/renderer/render_orchestrator.cpp index b6b16814f0..8acadd04b9 100644 --- a/src/mbgl/renderer/render_orchestrator.cpp +++ b/src/mbgl/renderer/render_orchestrator.cpp @@ -501,6 +501,7 @@ void RenderOrchestrator::queryRenderedSymbols(std::unordered_map<std::string, st const Placement& placement = *placementController.getPlacement(); auto renderedSymbols = placement.getCollisionIndex().queryRenderedSymbols(geometry); std::vector<std::reference_wrapper<const RetainedQueryData>> bucketQueryData; + bucketQueryData.reserve(renderedSymbols.size()); for (const auto& entry : renderedSymbols) { bucketQueryData.emplace_back(placement.getQueryData(entry.first)); } diff --git a/src/mbgl/util/tile_cover.cpp b/src/mbgl/util/tile_cover.cpp index 9e2451e1af..11d5e57d7f 100644 --- a/src/mbgl/util/tile_cover.cpp +++ b/src/mbgl/util/tile_cover.cpp @@ -122,6 +122,7 @@ std::vector<UnwrappedTileID> tileCover(const Point<double>& tl, }), t.end()); std::vector<UnwrappedTileID> result; + result.reserve(t.size()); for (const auto& id : t) { result.emplace_back(z, id.x, id.y); } |