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 <thiago.macieira@intel.com>
This commit is contained in:
Alex Trotsenko 2017-12-15 20:48:49 +02:00
parent ac8011c161
commit 7dee74147e

View File

@ -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;