backing out my optimization
This commit is contained in:
Родитель
b7e3fa3d4c
Коммит
24a9811989
|
@ -240,16 +240,17 @@ nsLocalFile::Clone(nsIFile **file)
|
|||
{
|
||||
CHECK_mPath();
|
||||
NS_ENSURE_ARG(file);
|
||||
*file = nsnull;
|
||||
|
||||
// Just copy-construct ourselves
|
||||
nsCOMPtr<nsILocalFile> localFile = new nsLocalFile(*this);
|
||||
|
||||
nsCOMPtr<nsILocalFile> localFile = new nsLocalFile();
|
||||
if (!localFile)
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
|
||||
nsresult rv = localFile->InitWithPath(mPath);
|
||||
if (NS_FAILED(rv))
|
||||
return rv;
|
||||
|
||||
*file = localFile;
|
||||
NS_ADDREF(*file);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
|
|
@ -650,18 +650,18 @@ nsLocalFile::ResolveAndStat(PRBool resolveTerminal)
|
|||
NS_IMETHODIMP
|
||||
nsLocalFile::Clone(nsIFile **file)
|
||||
{
|
||||
NS_ENSURE_ARG(file);
|
||||
*file = nsnull;
|
||||
nsresult rv;
|
||||
|
||||
// Just copy-construct ourselves
|
||||
nsCOMPtr<nsILocalFile> localFile = new nsLocalFile(*this);
|
||||
if (localFile == NULL)
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
nsCOMPtr<nsILocalFile> localFile;
|
||||
|
||||
*file = localFile;
|
||||
NS_ADDREF(*file);
|
||||
|
||||
return NS_OK;
|
||||
rv = NS_NewLocalFile(mWorkingPath.get(), mFollowSymlinks, getter_AddRefs(localFile));
|
||||
|
||||
if (NS_SUCCEEDED(rv) && localFile)
|
||||
{
|
||||
return localFile->QueryInterface(NS_GET_IID(nsIFile), (void**)file);
|
||||
}
|
||||
|
||||
return rv;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
|
|
Загрузка…
Ссылка в новой задаче