зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1073711: Clean up nsCacheService::CreateSessionInternal; drop useless null-check of 'this' and after 'new', and use nsRefPtr::forget(). r=mayhemer
This commit is contained in:
Родитель
ab6a6fe5ab
Коммит
034807d6ba
|
@ -1323,12 +1323,9 @@ nsCacheService::CreateSessionInternal(const char * clientID,
|
|||
bool streamBased,
|
||||
nsICacheSession **result)
|
||||
{
|
||||
if (this == nullptr) return NS_ERROR_NOT_AVAILABLE;
|
||||
|
||||
nsCacheSession * session = new nsCacheSession(clientID, storagePolicy, streamBased);
|
||||
if (!session) return NS_ERROR_OUT_OF_MEMORY;
|
||||
|
||||
NS_ADDREF(*result = session);
|
||||
nsRefPtr<nsCacheSession> session =
|
||||
new nsCacheSession(clientID, storagePolicy, streamBased);
|
||||
session.forget(result);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче