QRingBuffer: simplify QRingChunk::clear()
Clear should bring the QRingChunk into the default-constructe state, so just assign {} instead of calling assign(QByteArray()), which is equivalent, but has to manipulate QBA's atomic ref-count, which makes it unlikely the compiler will optimize this call. Change-Id: Idab9c92ec84392d484395042db2427c668756efa Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> (cherry picked from commit 5f305e51b5058b0101c76210b2d804a4a4867362) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
parent
79d6450526
commit
ea8dec398e
@ -167,7 +167,7 @@ public:
|
||||
}
|
||||
inline void clear()
|
||||
{
|
||||
assign(QByteArray());
|
||||
*this = {};
|
||||
}
|
||||
|
||||
private:
|
||||
|
Loading…
x
Reference in New Issue
Block a user