summaryrefslogtreecommitdiff
path: root/src/plugins/cpptools/cppselectionchanger.cpp
diff options
context:
space:
mode:
authorNikolai Kosjar <nikolai.kosjar@qt.io>2019-02-07 12:53:52 +0100
committerNikolai Kosjar <nikolai.kosjar@qt.io>2019-02-08 08:43:44 +0000
commit9d25cb872022e08161672cb070735fb52440b625 (patch)
tree7554c3079581d78fe5d5ce807aad220fb9256028 /src/plugins/cpptools/cppselectionchanger.cpp
parentc62f811c4bf706cb5df5c17ddac7484a0c4d7904 (diff)
downloadqt-creator-9d25cb872022e08161672cb070735fb52440b625.tar.gz
CppTools: Avoid unused values
Value stored to 'newPosStart' during its initialization is never read [clang-analyzer-deadcode.DeadStores] Change-Id: Ib8e16cd1bfc3930588e4c10639f463d4f742da0e Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Diffstat (limited to 'src/plugins/cpptools/cppselectionchanger.cpp')
-rw-r--r--src/plugins/cpptools/cppselectionchanger.cpp12
1 files changed, 3 insertions, 9 deletions
diff --git a/src/plugins/cpptools/cppselectionchanger.cpp b/src/plugins/cpptools/cppselectionchanger.cpp
index e19c1711a6..98437c1ced 100644
--- a/src/plugins/cpptools/cppselectionchanger.cpp
+++ b/src/plugins/cpptools/cppselectionchanger.cpp
@@ -560,7 +560,6 @@ void CppSelectionChanger::fineTuneASTNodePositions(ASTNodePositions &positions)
qDebug() << "Is raw literal.";
// Start from positions that include quotes.
- int newPosStart = positions.astPosStart;
int newPosEnd = positions.astPosEnd;
// Decrement last position to skip last quote.
@@ -572,7 +571,7 @@ void CppSelectionChanger::fineTuneASTNodePositions(ASTNodePositions &positions)
// Start position will be the end position minus the size of the actual contents of the
// literal.
- newPosStart = newPosEnd - static_cast<int>(firstToken.string->size());
+ int newPosStart = newPosEnd - static_cast<int>(firstToken.string->size());
// Skip raw literal parentheses.
if (isRawLiteral)
@@ -591,13 +590,8 @@ void CppSelectionChanger::fineTuneASTNodePositions(ASTNodePositions &positions)
if (debug)
qDebug() << "Selecting inner contents of char literal.";
- int newPosStart = positions.astPosStart;
- int newPosEnd = positions.astPosEnd;
- newPosEnd = newPosEnd - 1;
- newPosStart = newPosEnd - static_cast<int>(firstToken.literal->size());
-
- positions.astPosStart = newPosStart;
- positions.astPosEnd = newPosEnd;
+ positions.astPosEnd = positions.astPosEnd - 1;
+ positions.astPosStart = positions.astPosEnd - int(firstToken.literal->size());
}
}
} else if (ForStatementAST *forStatementAST = ast->asForStatement()) {