Change FIFO::Optimize() frequency for large messages

refs #5513

refs #5524
This commit is contained in:
Michael Friedrich 2017-08-17 18:03:37 +02:00
parent a55df4637d
commit 7f787d90ec
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_Offset - m_DataSize > 1024) {
if (m_Offset > m_DataSize / 10 && m_Offset - m_DataSize > 1024) {
std::memmove(m_Buffer, m_Buffer + m_Offset, m_DataSize);
m_Offset = 0;