diff options
author | Minh Nguyễn <mxn@1ec5.org> | 2016-04-16 23:29:40 -0700 |
---|---|---|
committer | Minh Nguyễn <mxn@1ec5.org> | 2016-04-16 23:29:40 -0700 |
commit | 943c09f1c74123fff480f9a1de075cd63c42c855 (patch) | |
tree | d1652d754ece6a1c870a6790aa6f1b7828181ce3 /platform/ios/src/MGLAPIClient.m | |
parent | 6da746ac685f5f37b1b0b19e7085b4357482761b (diff) | |
download | qtlocation-mapboxgl-943c09f1c74123fff480f9a1de075cd63c42c855.tar.gz |
[ios, osx] Took advantage of C99
Now that #4641 has removed the prohibition against C99 extensions, this change removes many pragma statements that suppress warnings about variadic macros and designated initializers. Designated initializers and Elvis operators have been introduced wherever appropriate.
Diffstat (limited to 'platform/ios/src/MGLAPIClient.m')
-rw-r--r-- | platform/ios/src/MGLAPIClient.m | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/platform/ios/src/MGLAPIClient.m b/platform/ios/src/MGLAPIClient.m index 5ce8b40f1a..62886713eb 100644 --- a/platform/ios/src/MGLAPIClient.m +++ b/platform/ios/src/MGLAPIClient.m @@ -54,7 +54,7 @@ static NSString * const MGLAPIClientHTTPMethodPost = @"POST"; statusError = [NSError errorWithDomain:MGLErrorDomain code:1 userInfo:userInfo]; } if (completionHandler) { - error = error ? error : statusError; + error = error ?: statusError; completionHandler(error); } [self.dataTasks removeObject:dataTask]; @@ -120,7 +120,7 @@ static NSString * const MGLAPIClientHTTPMethodPost = @"POST"; NSString *appBuildNumber = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleVersion"]; NSString *semanticVersion = [NSBundle mgl_frameworkInfoDictionary][@"MGLSemanticVersionString"]; NSString *shortVersion = [NSBundle mgl_frameworkInfoDictionary][@"CFBundleShortVersionString"]; - NSString *sdkVersion = semanticVersion ? semanticVersion : shortVersion; + NSString *sdkVersion = semanticVersion ?: shortVersion; _userAgent = [NSString stringWithFormat:@"%@/%@/%@ %@/%@", appName, appVersion, appBuildNumber, MGLAPIClientUserAgentBase, sdkVersion]; } |