mirror of
https://github.com/AxioDL/nod.git
synced 2025-12-11 06:27:46 +00:00
General: Use std::make_unique where applicable
Makes for a little less reading in certain cases.
This commit is contained in:
@@ -26,10 +26,13 @@ public:
|
||||
};
|
||||
|
||||
std::unique_ptr<IReadStream> beginReadStream(uint64_t offset) const override {
|
||||
bool Err = false;
|
||||
auto ret = std::unique_ptr<IReadStream>(new ReadStream(m_fio->beginReadStream(offset), Err));
|
||||
if (Err)
|
||||
return {};
|
||||
bool err = false;
|
||||
auto ret = std::unique_ptr<IReadStream>(new ReadStream(m_fio->beginReadStream(offset), err));
|
||||
|
||||
if (err) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -46,14 +49,17 @@ public:
|
||||
};
|
||||
|
||||
std::unique_ptr<IWriteStream> beginWriteStream(uint64_t offset) const override {
|
||||
bool Err = false;
|
||||
auto ret = std::unique_ptr<IWriteStream>(new WriteStream(m_fio->beginWriteStream(offset), Err));
|
||||
if (Err)
|
||||
return {};
|
||||
bool err = false;
|
||||
auto ret = std::unique_ptr<IWriteStream>(new WriteStream(m_fio->beginWriteStream(offset), err));
|
||||
|
||||
if (err) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
};
|
||||
|
||||
std::unique_ptr<IDiscIO> NewDiscIOISO(SystemStringView path) { return std::unique_ptr<IDiscIO>(new DiscIOISO(path)); }
|
||||
std::unique_ptr<IDiscIO> NewDiscIOISO(SystemStringView path) { return std::make_unique<DiscIOISO>(path); }
|
||||
|
||||
} // namespace nod
|
||||
|
||||
Reference in New Issue
Block a user