Avoid unnecessary reallocs in FIFO::Optimize

refs #11014
This commit is contained in:
Gunnar Beutner 2016-01-28 13:09:17 +01:00
parent 56e7c24f1f
commit 6fc91a38eb
1 changed files with 1 additions and 1 deletions

View File

@ -67,7 +67,7 @@ void FIFO::ResizeBuffer(size_t newSize, bool decrease)
*/
void FIFO::Optimize(void)
{
if (m_DataSize < m_Offset) {
if (m_Offset - m_DataSize > 1024) {
std::memcpy(m_Buffer, m_Buffer + m_Offset, m_DataSize);
m_Offset = 0;