CppEditor: Simplify

bugprone-branch-clone
readability-simplify-boolean-expr

Change-Id: Id30a155e224370713d23b4b534fb82f5e630f36c
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
Nikolai Kosjar
2019-10-31 16:03:18 +01:00
parent d1912784c8
commit d337d03ce1
4 changed files with 7 additions and 30 deletions

View File

@@ -45,10 +45,7 @@ bool CMakeAutoCompleter::isInComment(const QTextCursor &cursor) const
// NOTE: This doesn't handle '#' inside quotes, nor multi-line comments
QTextCursor moved = cursor;
moved.movePosition(QTextCursor::StartOfLine, QTextCursor::KeepAnchor);
if (moved.selectedText().contains(QLatin1Char('#')))
return true;
else
return false;
return moved.selectedText().contains(QLatin1Char('#'));
}
bool CMakeAutoCompleter::isInString(const QTextCursor &cursor) const