QRingBuffer: improve skip() performance
Use free() instead of read(0, length) call. Change-Id: I284e2099a3fb639cb40525ae2ca7fea0d09a620f Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
This commit is contained in:
parent
bafbf3b872
commit
43b6101df3
@ -119,7 +119,10 @@ public:
|
||||
Q_CORE_EXPORT void append(const QByteArray &qba);
|
||||
|
||||
inline qint64 skip(qint64 length) {
|
||||
return read(0, length);
|
||||
qint64 bytesToSkip = qMin(length, bufferSize);
|
||||
|
||||
free(bytesToSkip);
|
||||
return bytesToSkip;
|
||||
}
|
||||
|
||||
Q_CORE_EXPORT qint64 readLine(char *data, qint64 maxLength);
|
||||
|
Loading…
Reference in New Issue
Block a user