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:
Marc Mutz 2021-12-13 12:01:35 +01:00 committed by Qt Cherry-pick Bot
parent 79d6450526
commit ea8dec398e

View File

@ -167,7 +167,7 @@ public:
}
inline void clear()
{
assign(QByteArray());
*this = {};
}
private: