Skip to content

Replace string comparisons with empty() method #16103

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion libsolidity/parsing/DocStringParser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
4 changes: 2 additions & 2 deletions libsolidity/parsing/Parser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ void Parser::parsePragmaVersion(SourceLocation const& _location, std::vector<Tok

ASTPointer<StructuredDocumentation> Parser::parseStructuredDocumentation()
{
if (m_scanner->currentCommentLiteral() != "")
if (!m_scanner->currentCommentLiteral().empty())
{
ASTNodeFactory nodeFactory{*this};
nodeFactory.setLocation(m_scanner->currentCommentLocation());
Expand Down Expand Up @@ -1445,7 +1445,7 @@ ASTPointer<Statement> Parser::parseStatement(bool _allowUnchecked)
RecursionGuard recursionGuard(*this);
ASTPointer<ASTString> docString;
ASTPointer<Statement> statement;
if (m_scanner->currentCommentLiteral() != "")
if (!m_scanner->currentCommentLiteral().empty())
docString = std::make_shared<ASTString>(m_scanner->currentCommentLiteral());
switch (m_scanner->currentToken())
{
Expand Down