[clang-tidy] Use .empty instead of comparing size
Found with readability-container-size-empty Signed-off-by: Rosen Penev <rosenp@gmail.com>
This commit is contained in:
committed by
Paul Beckingham
parent
d43fa66489
commit
a331cceded
@@ -208,8 +208,8 @@ std::string taskInfoDifferences (
|
||||
if (name != "uuid" &&
|
||||
name != "modified" &&
|
||||
before.get (name) != after.get (name) &&
|
||||
before.get (name) != "" &&
|
||||
after.get (name) != "")
|
||||
!before.get (name).empty() &&
|
||||
!after.get (name).empty())
|
||||
{
|
||||
if (name == "depends")
|
||||
{
|
||||
@@ -245,10 +245,10 @@ std::string renderAttribute (const std::string& name, const std::string& value,
|
||||
Column* col = Context::getContext ().columns[name];
|
||||
if (col &&
|
||||
col->type () == "date" &&
|
||||
value != "")
|
||||
!value.empty())
|
||||
{
|
||||
Datetime d ((time_t)strtol (value.c_str (), nullptr, 10));
|
||||
if (format == "")
|
||||
if (format.empty())
|
||||
return d.toString (Context::getContext ().config.get ("dateformat"));
|
||||
|
||||
return d.toString (format);
|
||||
@@ -379,7 +379,7 @@ void feedback_unblocked (const Task& task)
|
||||
for (auto& i : blocked)
|
||||
{
|
||||
auto blocking = dependencyGetBlocking (i);
|
||||
if (blocking.size () == 0)
|
||||
if (blocking.empty())
|
||||
{
|
||||
if (i.id)
|
||||
std::cout << format ("Unblocked {1} '{2}'.",
|
||||
@@ -402,7 +402,7 @@ void feedback_unblocked (const Task& task)
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
void feedback_backlog ()
|
||||
{
|
||||
if (Context::getContext ().config.get ("taskd.server") != "" &&
|
||||
if (!Context::getContext ().config.get ("taskd.server").empty() &&
|
||||
Context::getContext ().verbose ("sync"))
|
||||
{
|
||||
int count = 0;
|
||||
@@ -423,7 +423,7 @@ std::string onProjectChange (Task& task, bool scope /* = true */)
|
||||
std::stringstream msg;
|
||||
std::string project = task.get ("project");
|
||||
|
||||
if (project != "")
|
||||
if (!project.empty())
|
||||
{
|
||||
if (scope)
|
||||
msg << format ("The project '{1}' has changed.", project)
|
||||
|
||||
Reference in New Issue
Block a user