From 936cc33d5291a77bc4e0dda9c7956860bef5f872 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Minh=20Nguye=CC=82=CC=83n?= Date: Sun, 12 Mar 2017 15:43:33 -0700 Subject: [PATCH] [ios, macos] Resolved unused variable warnings Resolved unused variable warnings in Release configuration that occurred because they were only used within NSAssert() invocations, which are omitted from Release builds. --- platform/darwin/src/MGLStyle.mm | 4 ++-- platform/macos/src/MGLMapView.mm | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/platform/darwin/src/MGLStyle.mm b/platform/darwin/src/MGLStyle.mm index 2e999a516..aa493d9ef 100644 --- a/platform/darwin/src/MGLStyle.mm +++ b/platform/darwin/src/MGLStyle.mm @@ -341,10 +341,10 @@ static NSURL *MGLStyleURL_emerald; styleLayer = [[MGLCircleStyleLayer alloc] initWithIdentifier:identifier source:source]; } else if (mbglLayer->is()) { styleLayer = [[MGLBackgroundStyleLayer alloc] initWithIdentifier:identifier]; - } else if (auto customLayer = mbglLayer->as()) { + } else if (mbglLayer->is()) { styleLayer = self.openGLLayers[identifier]; if (styleLayer) { - NSAssert(styleLayer.rawLayer == customLayer, @"%@ wraps a CustomLayer that differs from the one associated with the underlying style.", styleLayer); + NSAssert(styleLayer.rawLayer == mbglLayer->as(), @"%@ wraps a CustomLayer that differs from the one associated with the underlying style.", styleLayer); return styleLayer; } styleLayer = [[MGLOpenGLStyleLayer alloc] initWithIdentifier:identifier]; diff --git a/platform/macos/src/MGLMapView.mm b/platform/macos/src/MGLMapView.mm index e72a755f5..871195055 100644 --- a/platform/macos/src/MGLMapView.mm +++ b/platform/macos/src/MGLMapView.mm @@ -2419,9 +2419,11 @@ public: - (void)addOverlays:(NS_ARRAY_OF(id ) *)overlays { +#if DEBUG for (id overlay in overlays) { NSAssert([overlay conformsToProtocol:@protocol(MGLOverlay)], @"Overlay does not conform to MGLOverlay"); } +#endif [self addAnnotations:overlays]; } @@ -2430,9 +2432,11 @@ public: } - (void)removeOverlays:(NS_ARRAY_OF(id ) *)overlays { +#if DEBUG for (id overlay in overlays) { NSAssert([overlay conformsToProtocol:@protocol(MGLOverlay)], @"Overlay does not conform to MGLOverlay"); } +#endif [self removeAnnotations:overlays]; }