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>
This commit is contained in:
parent
c1aaa13939
commit
2d260eada8
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user