From 6fc91a38ebe8747732d5011fca426ca2f0decd5b Mon Sep 17 00:00:00 2001 From: Gunnar Beutner Date: Thu, 28 Jan 2016 13:09:17 +0100 Subject: [PATCH] Avoid unnecessary reallocs in FIFO::Optimize refs #11014 --- 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 e31b92e94..abe2c4dfd 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_DataSize < m_Offset) { + if (m_Offset - m_DataSize > 1024) { std::memcpy(m_Buffer, m_Buffer + m_Offset, m_DataSize); m_Offset = 0;