Remove unnecessary packager running check when saved JSLocation is empty

Summary:
Changelog:
When the JSLocation is nil, checking whether the address is running is unnesarry and wasting time, adding a JSLocation length check to mitigate that.

Reviewed By: cpojer

Differential Revision: D22644574

fbshipit-source-id: c51fc1a8976ebc25cba2653581e1bfa479a1d70d
This commit is contained in:
Jimmy Zhang
2020-07-21 09:55:11 -07:00
committed by Facebook GitHub Bot
parent da865b23a7
commit bbb7bef539
+1 -1
View File
@@ -126,7 +126,7 @@ static NSURL *serverRootWithHostPort(NSString *hostPort)
{
NSString *location = [self jsLocation];
#if RCT_DEV_MENU
if (![RCTBundleURLProvider isPackagerRunning:location]) {
if ([location length] && ![RCTBundleURLProvider isPackagerRunning:location]) {
location = nil;
}
#endif