diff --git a/React/Base/RCTJavaScriptLoader.mm b/React/Base/RCTJavaScriptLoader.mm index eacdf024f..60fa2c682 100755 --- a/React/Base/RCTJavaScriptLoader.mm +++ b/React/Base/RCTJavaScriptLoader.mm @@ -230,7 +230,7 @@ static void attemptAsynchronousLoadOfBundleAtURL(NSURL *scriptURL, RCTSourceLoad // For multipart responses packager sets X-Http-Status header in case HTTP status code // is different from 200 OK - NSString *statusCodeHeader = [headers valueForKey:@"X-Http-Status"]; + NSString *statusCodeHeader = headers[@"X-Http-Status"]; if (statusCodeHeader) { statusCode = [statusCodeHeader integerValue]; } @@ -263,9 +263,9 @@ static RCTLoadingProgress *progressEventFromData(NSData *rawData) } RCTLoadingProgress *progress = [RCTLoadingProgress new]; - progress.status = [info valueForKey:@"status"]; - progress.done = [info valueForKey:@"done"]; - progress.total = [info valueForKey:@"total"]; + progress.status = info[@"status"]; + progress.done = info[@"done"]; + progress.total = info[@"total"]; return progress; } @@ -281,12 +281,11 @@ static NSDictionary *userInfoForRawResponse(NSString *rawText) } NSMutableArray *fakeStack = [NSMutableArray new]; for (NSDictionary *err in errors) { - [fakeStack addObject: - @{ + [fakeStack addObject: @{ @"methodName": err[@"description"] ?: @"", @"file": err[@"filename"] ?: @"", @"lineNumber": err[@"lineNumber"] ?: @0 - }]; + }]; } return @{NSLocalizedDescriptionKey: parsedResponse[@"message"] ?: @"No message provided", @"stack": [fakeStack copy]}; }