From efe604c3920d6383c572f908fc0d0420551b703a Mon Sep 17 00:00:00 2001 From: Luke Seelenbinder Date: Fri, 17 Apr 2020 12:29:40 +0200 Subject: [PATCH] Better structure fix. --- src/mbgl/layout/symbol_layout.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/mbgl/layout/symbol_layout.cpp b/src/mbgl/layout/symbol_layout.cpp index c1eb49583..68aa8f5c7 100644 --- a/src/mbgl/layout/symbol_layout.cpp +++ b/src/mbgl/layout/symbol_layout.cpp @@ -696,10 +696,10 @@ void SymbolLayout::addFeature(const std::size_t layoutFeatureIndex, } else if (type == FeatureType::LineString) { for (const auto& line : feature.geometry) { // Skip invalid LineStrings. - if (line.size() > 0) { - Anchor anchor(line[0].x, line[0].y, 0, minScale); - addSymbolInstance(anchor, createSymbolInstanceSharedData(line)); - } + if (line.empty()) continue; + + Anchor anchor(line[0].x, line[0].y, 0, minScale); + addSymbolInstance(anchor, createSymbolInstanceSharedData(line)); } } else if (type == FeatureType::Point) { for (const auto& points : feature.geometry) {