mirror of
https://github.com/AxioDL/metaforce.git
synced 2025-12-15 07:26:10 +00:00
Runtime: Make use of std::make_unique where applicable
Makes use of the C++14 make_unique allocation function to allocate class instances where applicable instead of a reset with a new operator within it. This doesn't touch cases where buffers are allocated, given make_unique would zero-initialize them.
This commit is contained in:
@@ -37,7 +37,7 @@ CPuddleSpore::CPuddleSpore(TUniqueId uid, std::string_view name, EFlavorType fla
|
||||
, x614_25(false) {
|
||||
x5dc_elemGens.reserve(kEyeCount);
|
||||
for (u32 i = 0; i < kEyeCount; ++i)
|
||||
x5dc_elemGens.emplace_back(new CElementGen(x5d0_));
|
||||
x5dc_elemGens.emplace_back(std::make_unique<CElementGen>(x5d0_));
|
||||
x5ec_projectileInfo.Token().Lock();
|
||||
x460_knockBackController.SetAutoResetImpulse(false);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user