Get rid of unnecessary FSRef creation in startup path. b=506812 r=vlad

This commit is contained in:
Josh Aas 2009-09-27 01:49:41 -04:00
parent 1518dffcdd
commit 4a28606b59
2 changed files with 2 additions and 8 deletions

View File

@ -1407,13 +1407,7 @@ XRE_GetBinaryPath(const char* argv0, nsILocalFile* *aResult)
if (!bundleURL)
return NS_ERROR_FAILURE;
FSRef fileRef;
if (!CFURLGetFSRef(bundleURL, &fileRef)) {
CFRelease(bundleURL);
return NS_ERROR_FAILURE;
}
rv = lfm->InitWithFSRef(&fileRef);
rv = lfm->InitWithCFURL(bundleURL);
CFRelease(bundleURL);
if (NS_FAILED(rv))

View File

@ -1967,7 +1967,7 @@ nsresult nsLocalFile::SetBaseURL(CFURLRef aCFURLRef)
::CFRelease(mBaseURL);
mBaseURL = aCFURLRef;
if (!::CFURLGetFileSystemRepresentation(mBaseURL, NO, (UInt8*)mPath, PATH_MAX))
if (!::CFURLGetFileSystemRepresentation(mBaseURL, false, (UInt8*)mPath, PATH_MAX))
return NS_ERROR_FAILURE;
return NS_OK;