diff options
author | Alessandro Portale <alessandro.portale@qt.io> | 2020-01-15 19:10:34 +0100 |
---|---|---|
committer | Alessandro Portale <alessandro.portale@qt.io> | 2020-01-20 20:56:57 +0000 |
commit | 24a25eed1481a7c563431d79e3ad07840c0f7125 (patch) | |
tree | 3eb8a56dac620a31e6af362bf7c03201ea645771 /src/plugins/cppeditor/cpphighlighter.cpp | |
parent | ad4040972b9d763b2ceaa7444d18e65dd3da2ee9 (diff) |
Use isEmpty() instead of count() or size()
Change-Id: I0a89d2808c6d041da0dc41ea5aea58e6e8759bb4
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Diffstat (limited to 'src/plugins/cppeditor/cpphighlighter.cpp')
-rw-r--r-- | src/plugins/cppeditor/cpphighlighter.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/plugins/cppeditor/cpphighlighter.cpp b/src/plugins/cppeditor/cpphighlighter.cpp index 5abfe71a26..d862ea3c2c 100644 --- a/src/plugins/cppeditor/cpphighlighter.cpp +++ b/src/plugins/cppeditor/cpphighlighter.cpp @@ -74,7 +74,7 @@ void CppHighlighter::highlightBlock(const QString &text) if (tokens.isEmpty()) { setCurrentBlockState((braceDepth << 8) | lexerState); TextDocumentLayout::clearParentheses(currentBlock()); - if (text.length()) {// the empty line can still contain whitespace + if (!text.isEmpty()) {// the empty line can still contain whitespace if (initialLexerState == T_COMMENT) setFormatWithSpaces(text, 0, text.length(), formatForCategory(C_COMMENT)); else if (initialLexerState == T_DOXY_COMMENT) |