summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMinh Nguyễn <mxn@1ec5.org>2018-04-13 16:54:28 -0700
committerMinh Nguyễn <mxn@1ec5.org>2018-04-16 14:46:51 -0700
commit6c87574ea8b10d9d2cbb66e523f94aeb6f5383d9 (patch)
tree2bbb764024ea4bb9f4121ba3356b6ae19622a4e4
parenta53cd10a68a6aaebaa1d8e0f5407ab819b2042bb (diff)
downloadqtlocation-mapboxgl-6c87574ea8b10d9d2cbb66e523f94aeb6f5383d9.tar.gz
[ios, macos] Dictionary keys aren’t necessarily zoom levelsupstream/1ec5-l10n-e8n-10713
-rw-r--r--platform/darwin/src/NSExpression+MGLAdditions.mm6
1 files 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) {