diff options
Diffstat (limited to 'al/effect.cpp')
-rw-r--r-- | al/effect.cpp | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/al/effect.cpp b/al/effect.cpp index e5571be0..3836a5e4 100644 --- a/al/effect.cpp +++ b/al/effect.cpp @@ -130,7 +130,7 @@ void InitEffectParams(ALeffect *effect, ALenum type) } else { - effect->Props = EffectProps {}; + effect->Props = EffectProps{}; effect->vtab = nullptr; } effect->type = type; @@ -146,13 +146,9 @@ ALeffect *AllocEffect(ALCcontext *context) ); auto lidx = static_cast<ALsizei>(std::distance(device->EffectList.begin(), sublist)); - ALeffect *effect{nullptr}; ALsizei slidx{0}; if LIKELY(sublist != device->EffectList.end()) - { slidx = CTZ64(sublist->FreeMask); - effect = sublist->Effects + slidx; - } else { /* Don't allocate so many list entries that the 32-bit ID could @@ -175,10 +171,9 @@ ALeffect *AllocEffect(ALCcontext *context) } slidx = 0; - effect = sublist->Effects + slidx; } - effect = new (effect) ALeffect{}; + ALeffect *effect{::new (sublist->Effects + slidx) ALeffect{}}; InitEffectParams(effect, AL_EFFECT_NULL); /* Add 1 to avoid effect ID 0. */ |