From 7f787d90ec89df13162ff9934dafdd0cf849d5ce Mon Sep 17 00:00:00 2001 From: Michael Friedrich Date: Thu, 17 Aug 2017 18:03:37 +0200 Subject: [PATCH] Change FIFO::Optimize() frequency for large messages refs #5513 refs #5524 --- lib/base/fifo.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/base/fifo.cpp b/lib/base/fifo.cpp index 602899489..374a877c8 100644 --- a/lib/base/fifo.cpp +++ b/lib/base/fifo.cpp @@ -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;