diff --git a/libsolidity/parsing/DocStringParser.cpp b/libsolidity/parsing/DocStringParser.cpp index b9f358e020a0..13e43a9488ed 100644 --- a/libsolidity/parsing/DocStringParser.cpp +++ b/libsolidity/parsing/DocStringParser.cpp @@ -163,7 +163,7 @@ DocStringParser::iter DocStringParser::parseDocTag(iter _pos, iter _end, std::st { // TODO: need to check for @(start of a tag) between here and the end of line // for all cases. - if (!m_lastTag || _tag != "") + if (!m_lastTag || !_tag.empty()) { if (_tag == "param") return parseDocTagParam(_pos, _end); diff --git a/libsolidity/parsing/Parser.cpp b/libsolidity/parsing/Parser.cpp index 8889e65087fa..ddffdb600229 100644 --- a/libsolidity/parsing/Parser.cpp +++ b/libsolidity/parsing/Parser.cpp @@ -217,7 +217,7 @@ void Parser::parsePragmaVersion(SourceLocation const& _location, std::vector Parser::parseStructuredDocumentation() { - if (m_scanner->currentCommentLiteral() != "") + if (!m_scanner->currentCommentLiteral().empty()) { ASTNodeFactory nodeFactory{*this}; nodeFactory.setLocation(m_scanner->currentCommentLocation()); @@ -1445,7 +1445,7 @@ ASTPointer Parser::parseStatement(bool _allowUnchecked) RecursionGuard recursionGuard(*this); ASTPointer docString; ASTPointer statement; - if (m_scanner->currentCommentLiteral() != "") + if (!m_scanner->currentCommentLiteral().empty()) docString = std::make_shared(m_scanner->currentCommentLiteral()); switch (m_scanner->currentToken()) {