diff options
author | Kent Hansen <khansen@trolltech.com> | 2009-10-28 16:45:46 +0100 |
---|---|---|
committer | Kent Hansen <khansen@trolltech.com> | 2009-10-29 12:48:20 +0100 |
commit | 093ededb85c73f30ce3abf43bc6da0fff55323c2 (patch) | |
tree | 0557a7a11628f216e8b3663eecfa0fa34a4bde81 /src/corelib/statemachine/qstate_p.h | |
parent | 30099d68599d23b7e9c39e3f2e23a1bb5c6dd7dc (diff) |
Cache QState's child states
This is the same type of optimization as that done for transitions in
commit 5d8dcd57cd13fdd9c8643fa3bdda9f197a4351ff. The idea is to avoid
calling qobject_cast() because it's very expensive.
Obtaining child states needs to be as fast as possible because it's in
the critical path of the state machine algorithm; it's called by a ton
of internal functions, like isCompound(), isAtomic(), isInFinalState().
It's also called heavily for parallel state groups.
Reviewed-by: Eskil Abrahamsen Blomfeldt
Diffstat (limited to 'src/corelib/statemachine/qstate_p.h')
-rw-r--r-- | src/corelib/statemachine/qstate_p.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/corelib/statemachine/qstate_p.h b/src/corelib/statemachine/qstate_p.h index 3b5f416436..34c883831e 100644 --- a/src/corelib/statemachine/qstate_p.h +++ b/src/corelib/statemachine/qstate_p.h @@ -99,6 +99,8 @@ public: QAbstractState *errorState; QAbstractState *initialState; QState::ChildMode childMode; + mutable bool childStatesListNeedsRefresh; + mutable QList<QAbstractState*> childStatesList; mutable bool transitionsListNeedsRefresh; mutable QList<QAbstractTransition*> transitionsList; |