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>
This commit is contained in:
Nikolai Kosjar
2019-02-07 12:53:52 +01:00
parent c62f811c4b
commit 9d25cb8720

View File

@@ -560,7 +560,6 @@ void CppSelectionChanger::fineTuneASTNodePositions(ASTNodePositions &positions)
qDebug() << "Is raw literal."; qDebug() << "Is raw literal.";
// Start from positions that include quotes. // Start from positions that include quotes.
int newPosStart = positions.astPosStart;
int newPosEnd = positions.astPosEnd; int newPosEnd = positions.astPosEnd;
// Decrement last position to skip last quote. // 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 // Start position will be the end position minus the size of the actual contents of the
// literal. // literal.
newPosStart = newPosEnd - static_cast<int>(firstToken.string->size()); int newPosStart = newPosEnd - static_cast<int>(firstToken.string->size());
// Skip raw literal parentheses. // Skip raw literal parentheses.
if (isRawLiteral) if (isRawLiteral)
@@ -591,13 +590,8 @@ void CppSelectionChanger::fineTuneASTNodePositions(ASTNodePositions &positions)
if (debug) if (debug)
qDebug() << "Selecting inner contents of char literal."; qDebug() << "Selecting inner contents of char literal.";
int newPosStart = positions.astPosStart; positions.astPosEnd = positions.astPosEnd - 1;
int newPosEnd = positions.astPosEnd; positions.astPosStart = positions.astPosEnd - int(firstToken.literal->size());
newPosEnd = newPosEnd - 1;
newPosStart = newPosEnd - static_cast<int>(firstToken.literal->size());
positions.astPosStart = newPosStart;
positions.astPosEnd = newPosEnd;
} }
} }
} else if (ForStatementAST *forStatementAST = ast->asForStatement()) { } else if (ForStatementAST *forStatementAST = ast->asForStatement()) {