summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlex Trotsenko <alex1973tr@gmail.com>2017-12-15 20:48:49 +0200
committerAlex Trotsenko <alex1973tr@gmail.com>2017-12-19 18:07:59 +0000
commit7dee74147e628a95b783b090209c488a7dffe591 (patch)
treee865c45b7b8ca7452aa728650209a11ff9b421cd
parentac8011c16171f73526e65b3862ef06164ff4f376 (diff)
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>
-rw-r--r--src/corelib/tools/qringbuffer.cpp2
1 files changed, 1 insertions, 1 deletions
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;