Skip to content

Commit d0f6e0b

Browse files
authored
Merge pull request #16103 from eeemmmmmm/develop
Replace string comparisons with empty() method
2 parents 82b4b5d + a81065a commit d0f6e0b

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

libsolidity/parsing/DocStringParser.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ DocStringParser::iter DocStringParser::parseDocTag(iter _pos, iter _end, std::st
163163
{
164164
// TODO: need to check for @(start of a tag) between here and the end of line
165165
// for all cases.
166-
if (!m_lastTag || _tag != "")
166+
if (!m_lastTag || !_tag.empty())
167167
{
168168
if (_tag == "param")
169169
return parseDocTagParam(_pos, _end);

libsolidity/parsing/Parser.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ void Parser::parsePragmaVersion(SourceLocation const& _location, std::vector<Tok
217217

218218
ASTPointer<StructuredDocumentation> Parser::parseStructuredDocumentation()
219219
{
220-
if (m_scanner->currentCommentLiteral() != "")
220+
if (!m_scanner->currentCommentLiteral().empty())
221221
{
222222
ASTNodeFactory nodeFactory{*this};
223223
nodeFactory.setLocation(m_scanner->currentCommentLocation());
@@ -1445,7 +1445,7 @@ ASTPointer<Statement> Parser::parseStatement(bool _allowUnchecked)
14451445
RecursionGuard recursionGuard(*this);
14461446
ASTPointer<ASTString> docString;
14471447
ASTPointer<Statement> statement;
1448-
if (m_scanner->currentCommentLiteral() != "")
1448+
if (!m_scanner->currentCommentLiteral().empty())
14491449
docString = std::make_shared<ASTString>(m_scanner->currentCommentLiteral());
14501450
switch (m_scanner->currentToken())
14511451
{

0 commit comments

Comments
 (0)