mirror of
https://github.com/AxioDL/nod.git
synced 2025-12-10 14:07:51 +00:00
Merge pull request #11 from lioncash/make
General: Use std::make_unique where applicable
This commit is contained in:
16
lib/nod.cpp
16
lib/nod.cpp
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user