summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAlex Trotsenko <alex1973tr@gmail.com>2018-01-05 17:37:50 +0200
committerAlex Trotsenko <alex1973tr@gmail.com>2018-01-09 15:52:18 +0000
commit2d260eada8608e727b6bdb567da74c08b07b004f (patch)
treea09fdedac548489b4b06401f714e3ce66b7ec1b2 /src
parentc1aaa13939f3f2fdc46bccf718dbd406c243f741 (diff)
Micro-optimize QRingBuffer::free()
Change the condition to strong equal, as 'bytes' was checked against wrong value on the start of the function. Change-Id: I4ec4768b9fff3292af233417c4a5862d72d4eeac Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Diffstat (limited to 'src')
-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 c9ef3bc69a..d1a4ce79cb 100644
--- a/src/corelib/tools/qringbuffer.cpp
+++ b/src/corelib/tools/qringbuffer.cpp
@@ -120,7 +120,7 @@ void QRingBuffer::free(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 (chunk.capacity() <= basicBlockSize && !chunk.isShared()) {
chunk.reset();
bufferSize = 0;