summaryrefslogtreecommitdiffstats
path: root/src/corelib/statemachine/qfinalstate.cpp
diff options
context:
space:
mode:
authorKent Hansen <khansen@trolltech.com>2009-10-29 14:28:02 (GMT)
committerKent Hansen <khansen@trolltech.com>2009-10-30 09:12:58 (GMT)
commit83fff2f970b9a7b41861336c7dca0eadbda28099 (patch)
treeacbd743e52fe10c281755fb07e769732ce56f696 /src/corelib/statemachine/qfinalstate.cpp
parentdc4e074324eb91a8a16e14c86ff41b03647b4cfa (diff)
downloadQt-83fff2f970b9a7b41861336c7dca0eadbda28099.zip
Qt-83fff2f970b9a7b41861336c7dca0eadbda28099.tar.gz
Qt-83fff2f970b9a7b41861336c7dca0eadbda28099.tar.bz2
Introduce internal StateType to avoid excessive qobject_casts
The state machine algorithm frequently needs to know what type a state is, e.g. if it is atomic, final or a history state. We were using qobject_cast() to determine this, but that function is expensive. This commit introduces an internal StateType to be able to differentiate between the different types of state. This vastly improves performance. Reviewed-by: Eskil Abrahamsen Blomfeldt
Diffstat (limited to 'src/corelib/statemachine/qfinalstate.cpp')
-rw-r--r--src/corelib/statemachine/qfinalstate.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/corelib/statemachine/qfinalstate.cpp b/src/corelib/statemachine/qfinalstate.cpp
index 761eee4..d900ddd 100644
--- a/src/corelib/statemachine/qfinalstate.cpp
+++ b/src/corelib/statemachine/qfinalstate.cpp
@@ -92,6 +92,7 @@ public:
};
QFinalStatePrivate::QFinalStatePrivate()
+ : QAbstractStatePrivate(FinalState)
{
}