Merge pull request #11 from lioncash/make

General: Use std::make_unique where applicable
This commit is contained in:
2019-08-30 16:28:53 -07:00
committed by GitHub
9 changed files with 144 additions and 93 deletions

View File

@@ -55,18 +55,20 @@ std::unique_ptr<DiscBase> OpenDiscFromImage(SystemStringView path, bool& isWii)
return {};
}
bool Err = false;
bool err = false;
std::unique_ptr<DiscBase> ret;
if (isWii) {
ret = std::unique_ptr<DiscBase>(new DiscWii(std::move(discIO), Err));
if (Err)
return {};
ret = std::make_unique<DiscWii>(std::move(discIO), err);
if (err) {
return nullptr;
}
return ret;
}
ret = std::unique_ptr<DiscBase>(new DiscGCN(std::move(discIO), Err));
if (Err)
return {};
ret = std::make_unique<DiscGCN>(std::move(discIO), err);
if (err) {
return nullptr;
}
return ret;
}