diff options
author | Marc Mutz <marc.mutz@kdab.com> | 2014-08-27 00:04:11 +0200 |
---|---|---|
committer | Marc Mutz <marc.mutz@kdab.com> | 2015-07-04 06:03:39 +0000 |
commit | 160f4191d4de89c37d2f69b8023b3bfa457766cb (patch) | |
tree | f7ab44a484d74127c14402714316ebf04bf1a8b2 /mkspecs/aix-g++ | |
parent | b196573c9aea72fc5b35a4a9e8a7085af88385e8 (diff) |
Micro-optimize QKeySequence datastream operator (II)
Instead of reading a QList with the keys and then assigning the list
contents to the keysequence internals without any further checking
(not even for the size of the list, even though op<< creates lists
with just one element), do the processing by hand.
The greatest benefit is that there is are no memory allocations
anymore, except for the detach and whatever QDataStream does
internally.
The other benefit is that the output key sequence is not touched
until the necessary values have been successfully read. This
includes the detach. For this, some very basic error checking has
been added.
Also removed the magic number 4 in favor of the recently introduced
QKeySequencePrivate::MaxKeyCount.
Change-Id: If70f75cc043468d2774a7bb03eebdbf39422043a
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'mkspecs/aix-g++')
0 files changed, 0 insertions, 0 deletions