From 732a5849d5a0d682368d120af0742a2fd3ccd4b3 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 --- 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; -- 2.40.0