diff options
| author | Marc Mutz <marc.mutz@kdab.com> | 2015-12-03 13:47:27 +0100 |
|---|---|---|
| committer | Marc Mutz <marc.mutz@kdab.com> | 2015-12-03 19:58:45 +0000 |
| commit | 5d44d171274aef3d9e93cac8e958494220234151 (patch) | |
| tree | 76ece45caa3babfa3856798cccc3ae3fb14ed6a5 /src/sql/drivers/mysql/qsql_mysql.cpp | |
| parent | dd9df8d31f2c484c3fea56b78f959ed912807ff1 (diff) | |
QMacStyle: fix quadratic behavior
Repeatedly calling QVector::erase(it) (via QMutableVectorIterator::remove())
results in quadratic runtime.
Separate the removal of expired objects from the sending of the event to
the remaining objects, so we can use QVector::removeAll() for the former,
which does exactly what the old code tried to do, except in linear time.
Use range-for for the sending-loop. This could cause detaches, but since
we modify the container two lines before, and we don't copy it anymore,
anywhere, detaches are impossible.
Change-Id: I9aa6427e3646c8ad92b673fe42a86a0dfe79ee80
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Diffstat (limited to 'src/sql/drivers/mysql/qsql_mysql.cpp')
0 files changed, 0 insertions, 0 deletions
