summaryrefslogtreecommitdiffstats
path: root/src/corelib/statemachine
diff options
context:
space:
mode:
authorJarek Kobus <jaroslaw.kobus@theqtcompany.com>2015-10-29 16:49:04 +0100
committerJarek Kobus <jaroslaw.kobus@theqtcompany.com>2015-10-30 08:20:01 +0000
commitff3ba1045e8322caa0293b05aecbff4411963ea2 (patch)
treeab3ace5b90d4c03cd2474dfd4b8451280344675f /src/corelib/statemachine
parentf7f4dde80e13ff1c05a9399297ffb746ab505e62 (diff)
State machine: fix removeConflictingTransitions()
Since QSet<>::intersect() modifies the original set, exitSetT1 has wrong content for next iterations. Use intersects() instead. Change-Id: I09e0961ec6dfb34ade88d48d1e009529aeab82b4 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
Diffstat (limited to 'src/corelib/statemachine')
-rw-r--r--src/corelib/statemachine/qstatemachine.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/corelib/statemachine/qstatemachine.cpp b/src/corelib/statemachine/qstatemachine.cpp
index 31b079af0c..20d5ed890b 100644
--- a/src/corelib/statemachine/qstatemachine.cpp
+++ b/src/corelib/statemachine/qstatemachine.cpp
@@ -624,7 +624,7 @@ void QStateMachinePrivate::removeConflictingTransitions(QList<QAbstractTransitio
foreach (QAbstractTransition *t1, enabledTransitions) {
bool t1Preempted = false;
- QSet<QAbstractState*> exitSetT1 = computeExitSet_Unordered(t1, cache);
+ const QSet<QAbstractState*> exitSetT1 = computeExitSet_Unordered(t1, cache);
QList<QAbstractTransition*>::iterator t2It = filteredTransitions.begin();
while (t2It != filteredTransitions.end()) {
QAbstractTransition *t2 = *t2It;
@@ -636,7 +636,7 @@ void QStateMachinePrivate::removeConflictingTransitions(QList<QAbstractTransitio
}
QSet<QAbstractState*> exitSetT2 = computeExitSet_Unordered(t2, cache);
- if (exitSetT1.intersect(exitSetT2).isEmpty()) {
+ if (!exitSetT1.intersects(exitSetT2)) {
// No conflict, no cry. Next patient please.
++t2It;
} else {