diff options
author | Chris Robinson <[email protected]> | 2019-03-11 22:00:28 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2019-03-11 22:00:28 -0700 |
commit | 24b43fe85202d086eaae2cce5e376349651cc56c (patch) | |
tree | 2591eec5dcf0994d65f8affb96f865349887526e /Alc | |
parent | 30a7c6d86fba69130b6ed64731745135f207ba35 (diff) |
Remove a couple redundant local variables
Diffstat (limited to 'Alc')
-rw-r--r-- | Alc/mixvoice.cpp | 31 |
1 files changed, 14 insertions, 17 deletions
diff --git a/Alc/mixvoice.cpp b/Alc/mixvoice.cpp index 3e4cd1d2..47a2fb10 100644 --- a/Alc/mixvoice.cpp +++ b/Alc/mixvoice.cpp @@ -396,45 +396,42 @@ ALsizei LoadBufferQueue(ALbufferlistitem *BufferListItem, ALbufferlistitem *Buff const ALsizei SrcBufferSize) { /* Crawl the buffer queue to fill in the temp buffer */ - ALbufferlistitem *tmpiter{BufferListItem}; - ALsizei pos{DataPosInt}; - - while(tmpiter && SrcBufferSize > FilledAmt) + while(BufferListItem && SrcBufferSize > FilledAmt) { - if(pos >= tmpiter->max_samples) + if(DataPosInt >= BufferListItem->max_samples) { - pos -= tmpiter->max_samples; - tmpiter = tmpiter->next.load(std::memory_order_acquire); - if(!tmpiter) tmpiter = BufferLoopItem; + DataPosInt -= BufferListItem->max_samples; + BufferListItem = BufferListItem->next.load(std::memory_order_acquire); + if(!BufferListItem) BufferListItem = BufferLoopItem; continue; } const ALsizei SizeToDo{SrcBufferSize - FilledAmt}; - auto load_buffer = [pos,&SrcData,NumChannels,SampleSize,chan,FilledAmt,SizeToDo](ALsizei CompLen, const ALbuffer *buffer) -> ALsizei + auto load_buffer = [DataPosInt,&SrcData,NumChannels,SampleSize,chan,FilledAmt,SizeToDo](ALsizei CompLen, const ALbuffer *buffer) -> ALsizei { if(!buffer) return CompLen; ALsizei DataSize{buffer->SampleLen}; - if(pos >= DataSize) return CompLen; + if(DataPosInt >= DataSize) return CompLen; - DataSize = mini(SizeToDo, DataSize - pos); + DataSize = mini(SizeToDo, DataSize - DataPosInt); CompLen = maxi(CompLen, DataSize); const ALbyte *Data{buffer->mData.data()}; - Data += (pos*NumChannels + chan)*SampleSize; + Data += (DataPosInt*NumChannels + chan)*SampleSize; LoadSamples(&SrcData[FilledAmt], Data, NumChannels, buffer->mFmtType, DataSize); return CompLen; }; - auto buffers_end = tmpiter->buffers + tmpiter->num_buffers; - FilledAmt += std::accumulate(tmpiter->buffers, buffers_end, ALsizei{0}, + auto buffers_end = BufferListItem->buffers + BufferListItem->num_buffers; + FilledAmt += std::accumulate(BufferListItem->buffers, buffers_end, ALsizei{0}, load_buffer); if(SrcBufferSize <= FilledAmt) break; - pos = 0; - tmpiter = tmpiter->next.load(std::memory_order_acquire); - if(!tmpiter) tmpiter = BufferLoopItem; + DataPosInt = 0; + BufferListItem = BufferListItem->next.load(std::memory_order_acquire); + if(!BufferListItem) BufferListItem = BufferLoopItem; } return FilledAmt; |