Skip to content

Commit 720cda7

Browse files
committed
vf_settokenvalue.cpp: moved back isFloat and used it in another case in setTokenValue()
1 parent 890aaff commit 720cda7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/vf_settokenvalue.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -486,7 +486,8 @@ namespace ValueFlow
486486
continue;
487487
result.valueType = Value::ValueType::FLOAT;
488488
}
489-
if ((value1.isFloatValue() || value2.isFloatValue()) && Token::Match(parent, "&|^|%|<<|>>|==|!=|%or%"))
489+
const bool isFloat = value1.isFloatValue() || value2.isFloatValue();
490+
if (isFloat && Token::Match(parent, "&|^|%|<<|>>|==|!=|%or%"))
490491
continue;
491492
const auto intValue1 = [&]() -> MathLib::bigint {
492493
return value1.isFloatValue() ? static_cast<MathLib::bigint>(value1.floatValue) : value1.intvalue;
@@ -539,7 +540,6 @@ namespace ValueFlow
539540
}
540541
setTokenValue(parent, std::move(result), settings);
541542
} else if (Token::Match(parent, "%op%")) {
542-
const bool isFloat = value1.isFloatValue() || value2.isFloatValue();
543543
if (Token::Match(parent, "%comp%")) {
544544
if (!isFloat && !value1.isIntValue() && !value2.isIntValue())
545545
continue;

0 commit comments

Comments
 (0)