diff options
author | Marc Mutz <marc.mutz@kdab.com> | 2016-01-04 17:40:55 +0100 |
---|---|---|
committer | Marc Mutz <marc.mutz@kdab.com> | 2016-02-06 20:06:55 +0000 |
commit | 15238e91eb9e75ce6956852688fd1f0b68f9156a (patch) | |
tree | 523ba69feca31de077a34bd5e7713c901716c188 /src/plugins | |
parent | e13544f1868e38b97173abcf2790addacf3ae265 (diff) |
QList: don't lose reserved capacity in op+= with empty LHS
It is very rare that operator+= is used as operator=.
Most of the time, one op+= is followed by more op+=s.
The old code checked whether *this was empty, and simply
shallow-copied the RHS into the LHS in that case. This
has one severe drawback: a reserve() on the LHS is lost.
Fix by not checking for isEmpty() but for d == &shared_null.
Change-Id: Iff28e496cf24cc93f248449d74012c4f3a87253e
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Diffstat (limited to 'src/plugins')
0 files changed, 0 insertions, 0 deletions