Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

Commit

Permalink
Use emplace_hint for inserting render items
Browse files Browse the repository at this point in the history
  • Loading branch information
pozdnyakov committed Apr 12, 2019
1 parent feaff92 commit 4bc79cf
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/mbgl/renderer/renderer_impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -236,10 +236,10 @@ void Renderer::Impl::render(const UpdateParameters& updateParameters) {

std::set<RenderItem> renderItems;
std::vector<const RenderLayerSymbolInterface*> renderItemsWithSymbols;
auto renderItemsEmplaceHint = renderItems.begin();

// Update all sources and initialize renderItems.
staticData->has3D = false;

for (const auto& sourceImpl : *sourceImpls) {
RenderSource* source = renderSources.at(sourceImpl->id).get();
std::vector<Immutable<Layer::Impl>> filteredLayersForSource;
Expand All @@ -263,7 +263,7 @@ void Renderer::Impl::render(const UpdateParameters& updateParameters) {
if (layerNeedsRendering) {
sourceNeedsRendering = true;
filteredLayersForSource.push_back(layerImpl);
renderItems.emplace(*layer, source, index);
renderItemsEmplaceHint = renderItems.emplace_hint(renderItemsEmplaceHint, *layer, source, index);
}
}
continue;
Expand All @@ -278,7 +278,7 @@ void Renderer::Impl::render(const UpdateParameters& updateParameters) {
continue; // This layer is shown with background color, and it shall not be added to render items.
}
}
renderItems.emplace(*layer, nullptr, index);
renderItemsEmplaceHint = renderItems.emplace_hint(renderItemsEmplaceHint, *layer, nullptr, index);
}
}
source->update(sourceImpl,
Expand Down

0 comments on commit 4bc79cf

Please sign in to comment.