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:
parent
5d12942676
commit
5f305e51b5
@ -167,7 +167,7 @@ public:
|
|||||||
}
|
}
|
||||||
inline void clear()
|
inline void clear()
|
||||||
{
|
{
|
||||||
assign(QByteArray());
|
*this = {};
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user