From c5292b7536b5b3a7af83b6616aea84b0d65a4556 Mon Sep 17 00:00:00 2001 From: John Firebaugh Date: Mon, 6 Apr 2015 11:54:19 -0700 Subject: [PATCH] Remove always-true conditional --- src/mbgl/map/live_tile_data.cpp | 25 ++++++++++--------------- 1 file changed, 10 insertions(+), 15 deletions(-) diff --git a/src/mbgl/map/live_tile_data.cpp b/src/mbgl/map/live_tile_data.cpp index 8109b7e6e..71b5a2e1b 100644 --- a/src/mbgl/map/live_tile_data.cpp +++ b/src/mbgl/map/live_tile_data.cpp @@ -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());