diff options
author | Chris Robinson <[email protected]> | 2021-12-17 04:14:39 -0800 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2021-12-17 04:14:39 -0800 |
commit | 3ed913f6dde4340325079a9c6d14e69c9731e11a (patch) | |
tree | be143b84beab0ec813201d1dad075524acb05b14 /alc | |
parent | c9537abfb1a9d1c94d6bf9aa0e6cfa2cda1ae94b (diff) |
Remove an unnecessary parameter
Diffstat (limited to 'alc')
-rw-r--r-- | alc/context.cpp | 24 |
1 files changed, 10 insertions, 14 deletions
diff --git a/alc/context.cpp b/alc/context.cpp index 297d24a6..0b6bd022 100644 --- a/alc/context.cpp +++ b/alc/context.cpp @@ -171,21 +171,17 @@ ContextBase::~ContextBase() } } -void ContextBase::allocVoiceChanges(size_t addcount) +void ContextBase::allocVoiceChanges() { constexpr size_t clustersize{128}; - /* Convert element count to cluster count. */ - addcount = (addcount+(clustersize-1)) / clustersize; - while(addcount) - { - VoiceChangeCluster cluster{std::make_unique<VoiceChange[]>(clustersize)}; - for(size_t i{1};i < clustersize;++i) - cluster[i-1].mNext.store(std::addressof(cluster[i]), std::memory_order_relaxed); - cluster[clustersize-1].mNext.store(mVoiceChangeTail, std::memory_order_relaxed); - mVoiceChangeClusters.emplace_back(std::move(cluster)); - mVoiceChangeTail = mVoiceChangeClusters.back().get(); - --addcount; - } + + VoiceChangeCluster cluster{std::make_unique<VoiceChange[]>(clustersize)}; + for(size_t i{1};i < clustersize;++i) + cluster[i-1].mNext.store(std::addressof(cluster[i]), std::memory_order_relaxed); + cluster[clustersize-1].mNext.store(mVoiceChangeTail, std::memory_order_relaxed); + + mVoiceChangeClusters.emplace_back(std::move(cluster)); + mVoiceChangeTail = mVoiceChangeClusters.back().get(); } void ContextBase::allocVoiceProps() @@ -287,7 +283,7 @@ void ALCcontext::init() } mActiveAuxSlots.store(auxslots, std::memory_order_relaxed); - allocVoiceChanges(1); + allocVoiceChanges(); { VoiceChange *cur{mVoiceChangeTail}; while(VoiceChange *next{cur->mNext.load(std::memory_order_relaxed)}) |