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>
This commit is contained in:
Jarek Kobus 2015-10-29 16:49:04 +01:00
parent f7f4dde80e
commit ff3ba1045e

View File

@ -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 {