Fix performance regression when appending one vector to another
authorLars Knoll <lars.knoll@nokia.com>
Fri, 7 Sep 2012 08:02:04 +0000 (10:02 +0200)
committerQt by Nokia <qt-info@nokia.com>
Fri, 7 Sep 2012 16:41:22 +0000 (18:41 +0200)
commit3a48320fd6335d21451f07cb68336404177e2d87
tree598a446840aad5740703c5019a44062c22a0c00a
parent5b1bc864a91c3bdb02e36e7546dadebabb42fdec
Fix performance regression when appending one vector to another

When appending a QVector to an existing vector the code would
unconditionally realloc the vector instead of first checking
whether we can do without. This gives a quadratic behaviour when
repeatedly appending a vector to another.

Change-Id: I2cd81253e6a8aec0bc4402e6fbda262435080966
Reviewed-by: Qt Doc Bot <qt_docbot@qt-project.org>
Reviewed-by: Simon Hausmann <simon.hausmann@nokia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
src/corelib/tools/qvector.h