diff options
author | Marc Mutz <marc.mutz@qt.io> | 2021-12-14 23:34:36 +0100 |
---|---|---|
committer | Marc Mutz <marc.mutz@qt.io> | 2022-01-03 12:22:53 +0100 |
commit | 612417ea701b5276abd392af383fff3133b95a47 (patch) | |
tree | 8cb966c34ab453a522cfca5726d89d6a02d1086a /cmake/QtAndroidHelpers.cmake | |
parent | ab2439080432b5d637f3c22d4a0767cc842079d9 (diff) |
QRingBuffer: optimize and simplify QRingChunk::toByteArray() futher
- use sliced() instead of mid(), since we know we call sliced()
in-contract
- replace the manual memmove() with calls to QBA::remove(), but first
resize() to tailOffset, and only then remove(0, headOffset), so we
only move Chunk::size() bytes, as the old code did
- don't bother updating the offset members, as we're restricted to
rvalues now, and we only need to leave behind a partially-formed
object
This code shows that we desperately need QBA::slice() and/or an rvalue
overload of QBA::sliced(), cf. QTBUG-99218. Add a comment to use these
functions when they become available.
Change-Id: I5d8c7363d443dff69338f6f6a7b4bff9957917ec
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Alex Trotsenko <alex1973tr@gmail.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
Diffstat (limited to 'cmake/QtAndroidHelpers.cmake')
0 files changed, 0 insertions, 0 deletions