diff options
| author | Marc Mutz <marc.mutz@kdab.com> | 2017-05-17 14:40:05 +0200 |
|---|---|---|
| committer | Marc Mutz <marc.mutz@kdab.com> | 2017-05-22 18:16:38 +0000 |
| commit | 6d44fa53e1fee4b94ed0064a0bf3c89cbf7038f9 (patch) | |
| tree | 0dabf568949d9351daaa106ab792474db6db8a15 /src/corelib/tools/qscopedpointer.cpp | |
| parent | 33c59be551014c656370e0459c6cb5094ae68f3f (diff) | |
QItemSelection: fix a quadratic loop
QList::erase(it) is a linear operation. Calling it in a loop
constitutes quadratic behavior.
Fix by using the erase-remove idiom.
Write a generic function object QtFunctionObjects::IsNotValid, instead
of a lambda, because I am building up a collection of such function
objects in my tree, to be submitted any time now™, so this will reduce
the churn once that gets merged. Wrap it in the unnamed namespace to
avoid ODR violations in case this pattern repeats.
Replace an existing erase-remove idiom's isNotValid lambda function
with the new function object.
Change-Id: I4f0af04e7b201eb168e79beeda332eee3c6f33c3
Reviewed-by: Anton Kudryavtsev <antkudr@mail.ru>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Diffstat (limited to 'src/corelib/tools/qscopedpointer.cpp')
0 files changed, 0 insertions, 0 deletions
