summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFabian Guerra <fabian.guerra@mapbox.com>2018-05-21 16:38:32 -0400
committerFabian Guerra <fabian.guerra@mapbox.com>2018-05-21 16:38:32 -0400
commit2ffc1a329aaa35a6cc4fb437ecee5d8f0e325997 (patch)
tree859dd848b6027e5081ae3ecbc2ced214d81fc294
parentbef2a7ccb6e800d2ca6f2bac5c863b49fbba103d (diff)
downloadqtlocation-mapboxgl-upstream/fabian-computed-shape-11957.tar.gz
[ios, macos] Fix featuresInCoordinateBounds cpu usage when features are empty.upstream/fabian-computed-shape-11957
-rw-r--r--platform/darwin/src/MGLComputedShapeSource.mm2
1 files changed, 1 insertions, 1 deletions
diff --git a/platform/darwin/src/MGLComputedShapeSource.mm b/platform/darwin/src/MGLComputedShapeSource.mm
index 04734d0ef5..5f5427838f 100644
--- a/platform/darwin/src/MGLComputedShapeSource.mm
+++ b/platform/darwin/src/MGLComputedShapeSource.mm
@@ -125,7 +125,7 @@ mbgl::style::CustomGeometrySource::Options MBGLCustomGeometrySourceOptionsFromDi
zoomLevel:self.z];
}
- if(![self isCancelled]) {
+ if(![self isCancelled] && data.count > 0) {
mbgl::FeatureCollection featureCollection;
featureCollection.reserve(data.count);
for (MGLShape <MGLFeature> * feature in data) {