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.

Pick-to: 6.3
Change-Id: Idab9c92ec84392d484395042db2427c668756efa
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
This commit is contained in:
Marc Mutz 2021-12-13 12:01:35 +01:00
parent 5d12942676
commit 5f305e51b5

View File

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