mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-06-26 10:54:26 +02:00
[clang-tidy] Simplify boolean expressions
Found with readability-simplify-boolean-expr Signed-off-by: Rosen Penev <rosenp@gmail.com>
This commit is contained in:
parent
13e1bf7204
commit
51870dff34
8 changed files with 25 additions and 51 deletions
|
@ -75,7 +75,7 @@ bool Lexer::token (std::string& token, Lexer::Type& type)
|
|||
// - path < substitution < pattern
|
||||
// - set < number
|
||||
// - word last
|
||||
if (isString (token, type, "'\"") ||
|
||||
return isString (token, type, "'\"") ||
|
||||
isDate (token, type) ||
|
||||
isDuration (token, type) ||
|
||||
isURL (token, type) ||
|
||||
|
@ -92,10 +92,7 @@ bool Lexer::token (std::string& token, Lexer::Type& type)
|
|||
isPattern (token, type) ||
|
||||
isOperator (token, type) ||
|
||||
isIdentifier (token, type) ||
|
||||
isWord (token, type))
|
||||
return true;
|
||||
|
||||
return false;
|
||||
isWord (token, type);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -266,10 +263,7 @@ void Lexer::dequote (std::string& input, const std::string& quotes)
|
|||
// escapes, to get them past the shell.
|
||||
bool Lexer::wasQuoted (const std::string& input)
|
||||
{
|
||||
if (input.find_first_of (" \t()<>&~") != std::string::npos)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
return input.find_first_of (" \t()<>&~") != std::string::npos;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -1571,7 +1565,7 @@ bool Lexer::readWord (
|
|||
prev = c;
|
||||
}
|
||||
|
||||
return word.length () > 0 ? true : false;
|
||||
return word.length () > 0;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue