summaryrefslogtreecommitdiff
path: root/src/xmlpatterns
diff options
context:
space:
mode:
authorTimur Pocheptsov <timur.pocheptsov@theqtcompany.com>2016-05-31 14:49:31 +0200
committerTimur Pocheptsov <timur.pocheptsov@theqtcompany.com>2016-06-01 14:03:10 +0000
commit4240cd02d4af9fa1a3edec9a459789517cfd9c6e (patch)
treedd9a0f145f2950d63f6ab6b5b4327239ca4daf85 /src/xmlpatterns
parent4bedbbbb7f49f4cd6995effbebdee9198ca1558c (diff)
downloadqtxmlpatterns-4240cd02d4af9fa1a3edec9a459789517cfd9c6e.tar.gz
qxquerytokenizer - remove dead code
Simplify long and strange 'if(){return} else if () {return} else {return } dead_code; return' - as suggested by Coverity, CID 21875. Change-Id: I8a28b14003c6a533237163e44a549ac374344946 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@theqtcompany.com> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Diffstat (limited to 'src/xmlpatterns')
-rw-r--r--src/xmlpatterns/parser/qxquerytokenizer.cpp12
1 files changed, 4 insertions, 8 deletions
diff --git a/src/xmlpatterns/parser/qxquerytokenizer.cpp b/src/xmlpatterns/parser/qxquerytokenizer.cpp
index 69c24a4..5279a74 100644
--- a/src/xmlpatterns/parser/qxquerytokenizer.cpp
+++ b/src/xmlpatterns/parser/qxquerytokenizer.cpp
@@ -1691,19 +1691,15 @@ Tokenizer::Token XQueryTokenizer::nextToken()
const QChar next(m_data.at(m_pos + 1));
if (!next.isSpace() && next != QLatin1Char('/') && next != QLatin1Char('>'))
return Token(T_ERROR); // i18n Space must separate attributes
- else if (result.isEmpty())
+
+ if (result.isEmpty())
{
return tokenAndChangeState(state() == AposAttributeContent ? T_APOS : T_QUOTE,
StartTag, 1);
}
- else
- {
- /* Don't consume the sep, but leave it so we next time return a token for it. */
- return Token(T_STRING_LITERAL, result);
- }
- ++m_pos;
- continue;
+ /* Don't consume the sep, but leave it so we next time return a token for it. */
+ return Token(T_STRING_LITERAL, result);
}
else if (curr == QLatin1Char('{'))
{