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

Commit

Permalink
Review changes:
Browse files Browse the repository at this point in the history
- assert symbol layer tiles must be geometry tiles, instead of dynamically checking
- re-use retainedBucketQuery iterator instead of calling find twice.
  • Loading branch information
ChrisLoer committed Apr 25, 2018
1 parent 60cce56 commit c04cf57
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/mbgl/text/placement.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,10 @@ void Placement::placeLayer(RenderSymbolLayer& symbolLayer, const mat4& projMatri
std::unordered_set<uint32_t> seenCrossTileIDs;

for (RenderTile& renderTile : symbolLayer.renderTiles) {
if (!renderTile.tile.isRenderable() || !dynamic_cast<GeometryTile*>(&renderTile.tile)) {
if (!renderTile.tile.isRenderable()) {
continue;
}
assert(dynamic_cast<GeometryTile*>(&renderTile.tile));
GeometryTile& geometryTile = static_cast<GeometryTile&>(renderTile.tile);


Expand Down Expand Up @@ -314,8 +315,9 @@ void Placement::updateBucketOpacities(SymbolBucket& bucket, std::set<uint32_t>&

bucket.updateOpacity();
bucket.sortFeatures(state.getAngle());
if (retainedQueryData.find(bucket.bucketInstanceId) != retainedQueryData.end()) {
retainedQueryData.find(bucket.bucketInstanceId)->second.featureSortOrder = bucket.featureSortOrder;
auto retainedData = retainedQueryData.find(bucket.bucketInstanceId);
if (retainedData != retainedQueryData.end()) {
retainedData->second.featureSortOrder = bucket.featureSortOrder;
}
}

Expand Down

0 comments on commit c04cf57

Please sign in to comment.