[clang-tidy] Simplify boolean expressions

Found with readability-simplify-boolean-expr

Signed-off-by: Rosen Penev <rosenp@gmail.com>
This commit is contained in:
Rosen Penev
2019-09-27 20:53:23 -07:00
committed by Paul Beckingham
parent 13e1bf7204
commit 51870dff34
8 changed files with 25 additions and 51 deletions

View File

@@ -190,10 +190,7 @@ void Task::setAsNow (const std::string& att)
////////////////////////////////////////////////////////////////////////////////
bool Task::has (const std::string& name) const
{
if (data.find (name) != data.end ())
return true;
return false;
return data.find (name) != data.end ();
}
////////////////////////////////////////////////////////////////////////////////
@@ -1049,7 +1046,7 @@ int Task::getAnnotationCount () const
////////////////////////////////////////////////////////////////////////////////
bool Task::hasAnnotations () const
{
return annotation_count ? true : false;
return annotation_count != 0;
}
////////////////////////////////////////////////////////////////////////////////
@@ -1296,10 +1293,7 @@ bool Task::hasTag (const std::string& tag) const
// Concrete tags.
auto tags = split (get ("tags"), ',');
if (std::find (tags.begin (), tags.end (), tag) != tags.end ())
return true;
return false;
return std::find (tags.begin (), tags.end (), tag) != tags.end ();
}
////////////////////////////////////////////////////////////////////////////////
@@ -1368,7 +1362,7 @@ void Task::substitute (
const std::string& to,
const std::string& flags)
{
bool global = (flags.find ('g') != std::string::npos ? true : false);
bool global = (flags.find ('g') != std::string::npos);
// Get the data to modify.
std::string description = get ("description");