From 6c87574ea8b10d9d2cbb66e523f94aeb6f5383d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Minh=20Nguye=CC=82=CC=83n?= Date: Fri, 13 Apr 2018 16:54:28 -0700 Subject: =?UTF-8?q?[ios,=20macos]=20Dictionary=20keys=20aren=E2=80=99t=20n?= =?UTF-8?q?ecessarily=20zoom=20levels?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- platform/darwin/src/NSExpression+MGLAdditions.mm | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/platform/darwin/src/NSExpression+MGLAdditions.mm b/platform/darwin/src/NSExpression+MGLAdditions.mm index b18391018c..be6eef7f47 100644 --- a/platform/darwin/src/NSExpression+MGLAdditions.mm +++ b/platform/darwin/src/NSExpression+MGLAdditions.mm @@ -366,7 +366,7 @@ NS_ARRAY_OF(NSExpression *) *MGLCollectionByReplacingTokensWithKeyPaths(NS_ARRAY */ NS_DICTIONARY_OF(NSNumber *, NSExpression *) *MGLStopDictionaryByReplacingTokensWithKeyPaths(NS_DICTIONARY_OF(NSNumber *, NSExpression *) *stops) { __block NSMutableDictionary *upgradedStops; - [stops enumerateKeysAndObjectsUsingBlock:^(NSNumber * _Nonnull zoomLevel, NSExpression * _Nonnull value, BOOL * _Nonnull stop) { + [stops enumerateKeysAndObjectsUsingBlock:^(id _Nonnull zoomLevel, NSExpression * _Nonnull value, BOOL * _Nonnull stop) { if (![value isKindOfClass:[NSExpression class]]) { value = [NSExpression expressionForConstantValue:value]; } @@ -410,7 +410,6 @@ NS_DICTIONARY_OF(NSNumber *, NSExpression *) *MGLStopDictionaryByReplacingTokens arguments:@[[NSExpression expressionForAggregate:components]]]; } NSDictionary *stops = self.constantValue; - // TODO: Check whether the dictionary’s key and value types are consistent with stop dictionaries. Or have the caller pass in whether this is a stop dictionary. if ([stops isKindOfClass:[NSDictionary class]]) { NSDictionary *localizedStops = MGLStopDictionaryByReplacingTokensWithKeyPaths(stops); if (localizedStops != stops) { @@ -1245,7 +1244,7 @@ NS_ARRAY_OF(NSExpression *) *MGLLocalizedCollection(NS_ARRAY_OF(NSExpression *) */ NS_DICTIONARY_OF(NSNumber *, NSExpression *) *MGLLocalizedStopDictionary(NS_DICTIONARY_OF(NSNumber *, NSExpression *) *stops, NSLocale * _Nullable locale) { __block NSMutableDictionary *localizedStops; - [stops enumerateKeysAndObjectsUsingBlock:^(NSNumber * _Nonnull zoomLevel, NSExpression * _Nonnull value, BOOL * _Nonnull stop) { + [stops enumerateKeysAndObjectsUsingBlock:^(id _Nonnull zoomLevel, NSExpression * _Nonnull value, BOOL * _Nonnull stop) { if (![value isKindOfClass:[NSExpression class]]) { value = [NSExpression expressionForConstantValue:value]; } @@ -1264,7 +1263,6 @@ NS_DICTIONARY_OF(NSNumber *, NSExpression *) *MGLLocalizedStopDictionary(NS_DICT switch (self.expressionType) { case NSConstantValueExpressionType: { NSDictionary *stops = self.constantValue; - // TODO: Check whether the dictionary’s key and value types are consistent with stop dictionaries. Or have the caller pass in whether this is a stop dictionary. if ([stops isKindOfClass:[NSDictionary class]]) { NSDictionary *localizedStops = MGLLocalizedStopDictionary(stops, locale); if (localizedStops != stops) { -- cgit v1.2.1