Revert "[clang-tidy] Use .empty instead of comparing size"

This reverts commit a331cceded.
This commit is contained in:
Paul Beckingham 2020-12-05 16:18:15 -05:00
parent b2d46a1eba
commit 3e0a428185
18 changed files with 132 additions and 132 deletions

View file

@ -162,7 +162,7 @@ void A2::decompose ()
if (name == "rc")
{
if (!mod.empty())
if (mod != "")
tag ("CONFIG");
else
tag ("RC");
@ -258,7 +258,7 @@ bool CLI2::getDataLocation (int argc, const char** argv, Path& data)
if (value == nullptr)
{
std::string location = Context::getContext ().config.get ("data.location");
if (!location.empty())
if (location != "")
data = location;
return false;
}
@ -573,7 +573,7 @@ void CLI2::addContextFilter ()
// Detect if any context is set, and bail out if not
std::string contextName = Context::getContext ().config.get ("context");
if (contextName.empty())
if (contextName == "")
{
Context::getContext ().debug ("No context.");
return;
@ -595,7 +595,7 @@ void CLI2::addContextFilter ()
Context::getContext ().debug ("Applying context: " + contextName);
std::string contextFilter = Context::getContext ().config.get ("context." + contextName);
if (contextFilter.empty())
if (contextFilter == "")
Context::getContext ().debug ("Context '" + contextName + "' not defined.");
else
{
@ -635,14 +635,14 @@ void CLI2::prepareFilter ()
{
if (a.hasTag ("FILTER"))
{
if (!combined.empty())
if (combined != "")
combined += ' ';
combined += a.attribute ("raw");
}
}
if (!combined.empty())
if (combined.size ())
Context::getContext ().footnote (std::string ("Filter: ") + combined);
}
}
@ -704,7 +704,7 @@ bool CLI2::canonicalize (
////////////////////////////////////////////////////////////////////////////////
std::string CLI2::getBinary () const
{
if (!_args.empty())
if (_args.size ())
return _args[0].attribute ("raw");
return "";
@ -743,14 +743,14 @@ const std::string CLI2::dump (const std::string& title) const
out << '\n';
if (!_args.empty())
if (_args.size ())
{
out << " _args\n";
for (const auto& a : _args)
out << " " << a.dump () << '\n';
}
if (!_id_ranges.empty())
if (_id_ranges.size ())
{
out << " _id_ranges\n ";
for (const auto& range : _id_ranges)
@ -764,7 +764,7 @@ const std::string CLI2::dump (const std::string& title) const
out << '\n';
}
if (!_uuid_list.empty())
if (_uuid_list.size ())
{
out << " _uuid_list\n ";
for (const auto& uuid : _uuid_list)
@ -1229,7 +1229,7 @@ void CLI2::desugarFilterAttributes ()
// An unquoted string, while equivalent to an empty string, doesn't cause
// an operand shortage in eval.
if (value.empty())
if (value == "")
value = "''";
// Some values are expressions, which need to be lexed. The best way to
@ -1278,7 +1278,7 @@ void CLI2::desugarFilterAttributes ()
rhs.tag ("FILTER");
// Special case for '<name>:<value>'.
if (mod.empty())
if (mod == "")
{
op.attribute ("raw", "=");
rhs.attribute ("raw", value);
@ -1515,7 +1515,7 @@ void CLI2::findIDs ()
// listed as a MODIFICATION.
std::string command = getCommand ();
if (_id_ranges.empty() &&
if (! _id_ranges.size () &&
filterCount == 0 &&
command != "add" &&
command != "log")
@ -1606,7 +1606,7 @@ void CLI2::findUUIDs ()
}
}
if (_uuid_list.empty())
if (! _uuid_list.size ())
{
for (auto& a : _args)
{
@ -1655,8 +1655,8 @@ void CLI2::insertIDExpr ()
{
// Skip completely if no ID/UUID was found. This is because below, '(' and ')'
// are inserted regardless of list size.
if (_id_ranges.empty() &&
_uuid_list.empty())
if (! _id_ranges.size () &&
! _uuid_list.size ())
return;
// Find the *first* occurence of lexer type set/number/uuid, and replace it
@ -1759,8 +1759,8 @@ void CLI2::insertIDExpr ()
}
// Combine the ID and UUID sections with 'or'.
if (!_id_ranges.empty() &&
!_uuid_list.empty())
if (_id_ranges.size () &&
_uuid_list.size ())
reconstructed.push_back (opOr);
// Add all UUID list items.
@ -2033,7 +2033,7 @@ void CLI2::defaultCommand ()
{
// Apply overrides, if any.
std::string defaultCommand = Context::getContext ().config.get ("default.command");
if (!defaultCommand.empty())
if (defaultCommand != "")
{
// Modify _args, _original_args to be:
// <args0> [<def0> ...] <args1> [...]