[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.
This commit is contained in:
Minh Nguyễn
2017-03-12 15:43:33 -07:00
committed by Minh Nguyễn
parent 5120cbada4
commit 936cc33d52
2 changed files with 6 additions and 2 deletions

View File

@@ -341,10 +341,10 @@ static NSURL *MGLStyleURL_emerald;
styleLayer = [[MGLCircleStyleLayer alloc] initWithIdentifier:identifier source:source];
} else if (mbglLayer->is<mbgl::style::BackgroundLayer>()) {
styleLayer = [[MGLBackgroundStyleLayer alloc] initWithIdentifier:identifier];
} else if (auto customLayer = mbglLayer->as<mbgl::style::CustomLayer>()) {
} else if (mbglLayer->is<mbgl::style::CustomLayer>()) {
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<mbgl::style::CustomLayer>(), @"%@ wraps a CustomLayer that differs from the one associated with the underlying style.", styleLayer);
return styleLayer;
}
styleLayer = [[MGLOpenGLStyleLayer alloc] initWithIdentifier:identifier];

View File

@@ -2419,9 +2419,11 @@ public:
- (void)addOverlays:(NS_ARRAY_OF(id <MGLOverlay>) *)overlays
{
#if DEBUG
for (id <MGLOverlay> 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 <MGLOverlay>) *)overlays {
#if DEBUG
for (id <MGLOverlay> overlay in overlays) {
NSAssert([overlay conformsToProtocol:@protocol(MGLOverlay)], @"Overlay does not conform to MGLOverlay");
}
#endif
[self removeAnnotations:overlays];
}