diff options
author | Marc Mutz <marc.mutz@kdab.com> | 2015-12-24 00:27:39 +0100 |
---|---|---|
committer | Marc Mutz <marc.mutz@kdab.com> | 2015-12-31 18:44:53 +0000 |
commit | 9059931cd2103a814d247d35998d49f03e9131e5 (patch) | |
tree | b03c0ee0967ec8007ecdacb1ec5903462f2564c7 /src/corelib/statemachine | |
parent | eb9fdf7c0797b52d949ba90d33bf0c9d6e3a806a (diff) |
QStateMachine: replace a Q_FOREACH with QSet::op-=
Both 'configuration' and 'pendingErrorStates' are
QSet<QAbstractState*>, so we can use QSet::operator-=
to subtract one from the other. No need to loop
over QSet::remove() here.
Nevermind that QSet::operator-= is really poorly
implemented atm. That needs to be fixed in QSet.
Change-Id: I3f3172ce9a485c4c2abf7d19b831fb0dc1ea61b1
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Diffstat (limited to 'src/corelib/statemachine')
-rw-r--r-- | src/corelib/statemachine/qstatemachine.cpp | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/src/corelib/statemachine/qstatemachine.cpp b/src/corelib/statemachine/qstatemachine.cpp index 0ce3ecc30e..885bc69d6c 100644 --- a/src/corelib/statemachine/qstatemachine.cpp +++ b/src/corelib/statemachine/qstatemachine.cpp @@ -1499,8 +1499,7 @@ void QStateMachinePrivate::setError(QStateMachine::Error errorCode, QAbstractSta pendingErrorStates.insert(currentErrorState); addDescendantStatesToEnter(currentErrorState, pendingErrorStates, pendingErrorStatesForDefaultEntry); addAncestorStatesToEnter(currentErrorState, rootState(), pendingErrorStates, pendingErrorStatesForDefaultEntry); - foreach (QAbstractState *s, configuration) - pendingErrorStates.remove(s); + pendingErrorStates -= configuration; } else { qWarning("Unrecoverable error detected in running state machine: %s", qPrintable(errorString)); |