[core] Don't copy TileLayerIndexes on every frame.

Fixes issue #11811 (too much CPU time spent in CrossTileSymbolIndex).
This commit is contained in:
Chris Loer
2018-05-01 13:05:51 -07:00
committed by Chris Loer
parent b820ca4686
commit a6d70c2db7

View File

@@ -62,7 +62,7 @@ CrossTileSymbolLayerIndex::CrossTileSymbolLayerIndex() {
}
bool CrossTileSymbolLayerIndex::addBucket(const OverscaledTileID& tileID, SymbolBucket& bucket, uint32_t& maxCrossTileID) {
auto thisZoomIndexes = indexes[tileID.overscaledZ];
const auto& thisZoomIndexes = indexes[tileID.overscaledZ];
auto previousIndex = thisZoomIndexes.find(tileID);
if (previousIndex != thisZoomIndexes.end()) {
if (previousIndex->second.bucketInstanceId == bucket.bucketInstanceId) {