summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@qt.io>2018-01-16 10:31:33 +0100
committerLiang Qi <liang.qi@qt.io>2018-01-16 10:31:33 +0100
commit9427db361dfe3a8dddc9a5bbfa4cf442ecc19ec8 (patch)
tree6e011d85a764b8022f7c39b629009f89d20e078b /src
parent7ceeac41d44b81e1b76b13c473611ae5f25d8e88 (diff)
parent73823fa61d96303cbc6761908e0f4fac7ed5ebb6 (diff)
downloadqtxmlpatterns-9427db361dfe3a8dddc9a5bbfa4cf442ecc19ec8.tar.gz
Merge remote-tracking branch 'origin/5.10' into dev
Conflicts: .qmake.conf Change-Id: I6f68767536130d88d48c12e578eb7cd7cd19a40c
Diffstat (limited to 'src')
-rwxr-xr-xsrc/xmlpatterns/qtokenautomaton/regenerate.sh34
-rw-r--r--src/xmlpatterns/schema/qxsdstatemachine_tpl_p.h16
2 files changed, 27 insertions, 23 deletions
diff --git a/src/xmlpatterns/qtokenautomaton/regenerate.sh b/src/xmlpatterns/qtokenautomaton/regenerate.sh
index e095549..e51ba2a 100755
--- a/src/xmlpatterns/qtokenautomaton/regenerate.sh
+++ b/src/xmlpatterns/qtokenautomaton/regenerate.sh
@@ -2,32 +2,38 @@
#############################################################################
##
-## Copyright (C) 2017 The Qt Company Ltd.
-## Contact: http://www.qt.io/licensing/
+## Copyright (C) 2018 The Qt Company Ltd.
+## Contact: https://www.qt.io/licensing/
##
## This file is part of the build tools of the Qt Toolkit.
##
-## $QT_BEGIN_LICENSE:LGPL21$
+## $QT_BEGIN_LICENSE:LGPL$
## Commercial License Usage
## Licensees holding valid commercial Qt licenses may use this file in
## accordance with the commercial license agreement provided with the
## Software or, alternatively, in accordance with the terms contained in
## a written agreement between you and The Qt Company. For licensing terms
-## and conditions see http://www.qt.io/terms-conditions. For further
-## information use the contact form at http://www.qt.io/contact-us.
+## and conditions see https://www.qt.io/terms-conditions. For further
+## information use the contact form at https://www.qt.io/contact-us.
##
## GNU Lesser General Public License Usage
## Alternatively, this file may be used under the terms of the GNU Lesser
-## General Public License version 2.1 or version 3 as published by the Free
-## Software Foundation and appearing in the file LICENSE.LGPLv21 and
-## LICENSE.LGPLv3 included in the packaging of this file. Please review the
-## following information to ensure the GNU Lesser General Public License
-## requirements will be met: https://www.gnu.org/licenses/lgpl.html and
-## http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+## General Public License version 3 as published by the Free Software
+## Foundation and appearing in the file LICENSE.LGPL3 included in the
+## packaging of this file. Please review the following information to
+## ensure the GNU Lesser General Public License version 3 requirements
+## will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
##
-## As a special exception, The Qt Company gives you certain additional
-## rights. These rights are described in The Qt Company LGPL Exception
-## version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+## GNU General Public License Usage
+## Alternatively, this file may be used under the terms of the GNU
+## General Public License version 2.0 or (at your option) the GNU General
+## Public license version 3 or any later version approved by the KDE Free
+## Qt Foundation. The licenses are as published by the Free Software
+## Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+## included in the packaging of this file. Please review the following
+## information to ensure the GNU General Public License requirements will
+## be met: https://www.gnu.org/licenses/gpl-2.0.html and
+## https://www.gnu.org/licenses/gpl-3.0.html.
##
## $QT_END_LICENSE$
##
diff --git a/src/xmlpatterns/schema/qxsdstatemachine_tpl_p.h b/src/xmlpatterns/schema/qxsdstatemachine_tpl_p.h
index 1cb2e72..9277c1b 100644
--- a/src/xmlpatterns/schema/qxsdstatemachine_tpl_p.h
+++ b/src/xmlpatterns/schema/qxsdstatemachine_tpl_p.h
@@ -359,19 +359,14 @@ XsdStateMachine<TransitionType> XsdStateMachine<TransitionType>::toDFA() const
QList< QSet<StateId> > workStates;
// add the start state to the list of to processed state sets
- workStates.append(epsilonClosure(QSet<StateId>() << startState));
+ auto firstDfaState = epsilonClosure(QSet<StateId>() << startState);
+ workStates.append(firstDfaState);
+ isMarked.append(firstDfaState);
while (!workStates.isEmpty()) { // as long as there are state sets to process left
-
// enqueue set of states
const QSet<StateId> states = workStates.takeFirst();
- if (isMarked.contains(states)) // we processed this state set already
- continue;
-
- // mark as processed
- isMarked.append(states);
-
// select a list of all inputs that are possible for
// the 'states' set
QList<TransitionType> input;
@@ -395,7 +390,10 @@ XsdStateMachine<TransitionType> XsdStateMachine<TransitionType>::toDFA() const
dfa.addTransition(dfaBegin, input.at(i), dfaEnd);
// add the 'followStates' to the list of to be processed state sets
- workStates.append(followStates);
+ if (!isMarked.contains(followStates)) {
+ workStates.append(followStates);
+ isMarked.append(followStates); // only needs to be processed once
+ }
}
}