Remove always-true conditional

This commit is contained in:
John Firebaugh
2015-04-06 11:54:19 -07:00
parent 5ec04c0474
commit c5292b7536

View File

@@ -36,24 +36,19 @@ void LiveTileData::parse() {
throw std::runtime_error("style isn't present in LiveTileData object anymore");
}
if (source.type == SourceType::Annotations) {
const LiveTile* tile = annotationManager.getTile(id);
const LiveTile* tile = annotationManager.getTile(id);
if (tile) {
// Parsing creates state that is encapsulated in TileParser. While parsing,
// the TileParser object writes results into this objects. All other state
// is going to be discarded afterwards.
TileParser parser(*tile, *this, style, glyphAtlas, glyphStore, spriteAtlas, sprite);
if (tile) {
// Parsing creates state that is encapsulated in TileParser. While parsing,
// the TileParser object writes results into this objects. All other state
// is going to be discarded afterwards.
TileParser parser(*tile, *this, style, glyphAtlas, glyphStore, spriteAtlas, sprite);
// Clear the style so that we don't have a cycle in the shared_ptr references.
style.reset();
// Clear the style so that we don't have a cycle in the shared_ptr references.
style.reset();
parser.parse();
} else {
state = State::obsolete;
}
parser.parse();
} else {
throw std::runtime_error("unknown live tile source type");
state = State::obsolete;
}
} catch (const std::exception& ex) {
Log::Error(Event::ParseTile, "Live-parsing [%d/%d/%d] failed: %s", id.z, id.x, id.y, ex.what());