summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Seelenbinder <me@lukeseelenbinder.com>2020-04-17 12:29:40 +0200
committerLuke Seelenbinder <me@lukeseelenbinder.com>2020-04-17 12:29:40 +0200
commitaac041a6f51df17e5eb681354697c9fdc5a90733 (patch)
tree92db717b3edfb12604501ec0c5605bf46fe584eb
parent52ade30fa5365d165cf81cc4a35da20d97347247 (diff)
downloadqtlocation-mapboxgl-upstream/pr-16409.tar.gz
Better structure fix.upstream/pr-16409
-rw-r--r--src/mbgl/layout/symbol_layout.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/mbgl/layout/symbol_layout.cpp b/src/mbgl/layout/symbol_layout.cpp
index ae0f96c8ac..de96ea920f 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) {