From 7dee74147e628a95b783b090209c488a7dffe591 Mon Sep 17 00:00:00 2001 From: Alex Trotsenko Date: Fri, 15 Dec 2017 20:48:49 +0200 Subject: Micro-optimize QRingBuffer::chop() Change the condition to strong equal, as 'bytes' was checked against wrong value on the start of the function. Change-Id: Iebd785665ac7bd0941ba4ffd3f315b12efc6ce0b Reviewed-by: Thiago Macieira --- src/corelib/tools/qringbuffer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/corelib/tools/qringbuffer.cpp') diff --git a/src/corelib/tools/qringbuffer.cpp b/src/corelib/tools/qringbuffer.cpp index 8fa378e935..4dd58b4291 100644 --- a/src/corelib/tools/qringbuffer.cpp +++ b/src/corelib/tools/qringbuffer.cpp @@ -180,7 +180,7 @@ void QRingBuffer::chop(qint64 bytes) // keep a single block around if it does not exceed // the basic block size, to avoid repeated allocations // between uses of the buffer - if (bufferSize <= bytes) { + if (bufferSize == bytes) { if (buffers.constFirst().size() <= basicBlockSize) { bufferSize = 0; head = tail = 0; -- cgit v1.2.3