Skip to content

Commit 2507fa4

Browse files
committed
Fix clang-tidy boolean simplification
1 parent 5756e2a commit 2507fa4

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

‎simplecpp.cpp‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3034,8 +3034,9 @@ long long simplecpp::characterLiteralToLL(const std::string& str)
30343034

30353035
static bool isFloatingPointLiteral(const std::string &str)
30363036
{
3037-
if (!simplecpp::Token::isNumberLike(str) &&
3038-
!(str.size() > 1U && str[0] == '.' && std::isdigit(static_cast<unsigned char>(str[1]))))
3037+
const bool startsWithDotDigit = str.size() > 1U && str[0] == '.' &&
3038+
std::isdigit(static_cast<unsigned char>(str[1]));
3039+
if (!simplecpp::Token::isNumberLike(str) && !startsWithDotDigit)
30393040
return false;
30403041

30413042
if (str.find('.') != std::string::npos)

0 commit comments

Comments
 (0)