diff options
author | Stefan Radomski <radomski@tk.informatik.tu-darmstadt.de> | 2014-07-07 00:38:46 (GMT) |
---|---|---|
committer | Stefan Radomski <radomski@tk.informatik.tu-darmstadt.de> | 2014-07-07 00:38:46 (GMT) |
commit | d5e1f6397c52513018cd59972cf5ca8740de18eb (patch) | |
tree | 80448f6b414373f799273ed777ed0b7260605bdb /src/uscxml/transform/ChartToFSM.cpp | |
parent | 41312059e5d25539d3cd071829a505ebb7293393 (diff) | |
download | uscxml-d5e1f6397c52513018cd59972cf5ca8740de18eb.zip uscxml-d5e1f6397c52513018cd59972cf5ca8740de18eb.tar.gz uscxml-d5e1f6397c52513018cd59972cf5ca8740de18eb.tar.bz2 |
Appr. 15% performance boost by avoiding dynamic_cast in DOM
Diffstat (limited to 'src/uscxml/transform/ChartToFSM.cpp')
-rw-r--r-- | src/uscxml/transform/ChartToFSM.cpp | 21 |
1 files changed, 3 insertions, 18 deletions
diff --git a/src/uscxml/transform/ChartToFSM.cpp b/src/uscxml/transform/ChartToFSM.cpp index fea97d8..cc94434 100644 --- a/src/uscxml/transform/ChartToFSM.cpp +++ b/src/uscxml/transform/ChartToFSM.cpp @@ -182,7 +182,7 @@ InterpreterState FlatteningInterpreter::interpret() { return _state; } -void FlatteningInterpreter::executeContent(const Arabica::DOM::Node<std::string>& content, bool rethrow) { +void FlatteningInterpreter::executeContent(const Arabica::DOM::Element<std::string>& content, bool rethrow) { // std::cout << content << std::endl; GlobalTransition::Action action; @@ -199,19 +199,6 @@ void FlatteningInterpreter::executeContent(const Arabica::DOM::Node<std::string> _currGlobalTransition->actions.push_back(action); } -void FlatteningInterpreter::executeContent(const Arabica::DOM::NodeList<std::string>& content, bool rethrow) { - for (int i = 0; i < content.getLength(); i++) { - executeContent(content.item(i)); - } - assert(false); -} - -void FlatteningInterpreter::executeContent(const Arabica::XPath::NodeSet<std::string>& content, bool rethrow) { - for (int i = 0; i < content.size(); i++) { - executeContent(content[i]); - } -} - void FlatteningInterpreter::invoke(const Arabica::DOM::Node<std::string>& element) { GlobalTransition::Action action; action.invoke = element; @@ -226,10 +213,8 @@ void FlatteningInterpreter::cancelInvoke(const Arabica::DOM::Node<std::string>& _currGlobalTransition->uninvoke.push_back(element); } -void FlatteningInterpreter::internalDoneSend(const Arabica::DOM::Node<std::string>& state) { +void FlatteningInterpreter::internalDoneSend(const Arabica::DOM::Element<std::string>& state) { - if (!isState(state)) - return; Arabica::DOM::Element<std::string> stateElem = (Arabica::DOM::Element<std::string>)state; // if (parentIsScxmlState(state)) @@ -906,7 +891,7 @@ GlobalState::GlobalState(const Arabica::XPath::NodeSet<std::string>& activeState std::ostringstream idSS; idSS << "active-"; for (int i = 0; i < activeStates.size(); i++) { - if (!InterpreterImpl::isFinal(activeStates[i])) + if (!InterpreterImpl::isFinal(Element<std::string>(activeStates[i]))) isFinal = false; idSS << ATTR(activeStates[i], "id") << "-"; } |