[core] Avoid gratuitous SymbolBucket creation
This commit is contained in:
@@ -40,7 +40,8 @@ void SymbolBucket::render(Painter& painter,
|
||||
}
|
||||
|
||||
bool SymbolBucket::hasData() const {
|
||||
return hasTextData() || hasIconData();
|
||||
assert(false); // Should be calling SymbolLayout::hasSymbolInstances() instead.
|
||||
return false;
|
||||
}
|
||||
|
||||
bool SymbolBucket::hasTextData() const {
|
||||
|
||||
@@ -167,9 +167,9 @@ TilePlacementResult TileWorker::redoPlacement(const PlacementConfig& config) {
|
||||
|
||||
for (auto& symbolLayout : symbolLayouts) {
|
||||
symbolLayout->state = SymbolLayout::Placed;
|
||||
std::unique_ptr<Bucket> bucket = symbolLayout->place(*result.collisionTile);
|
||||
if (bucket->hasData() || symbolLayout->hasSymbolInstances()) {
|
||||
result.buckets.emplace(symbolLayout->bucketName, std::move(bucket));
|
||||
if (symbolLayout->hasSymbolInstances()) {
|
||||
result.buckets.emplace(symbolLayout->bucketName,
|
||||
symbolLayout->place(*result.collisionTile));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user