From 9059931cd2103a814d247d35998d49f03e9131e5 Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Thu, 24 Dec 2015 00:27:39 +0100 Subject: QStateMachine: replace a Q_FOREACH with QSet::op-= Both 'configuration' and 'pendingErrorStates' are QSet, 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) --- src/corelib/statemachine/qstatemachine.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/corelib/statemachine') 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)); -- cgit v1.2.3