We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1f16fc4 commit 49addc1Copy full SHA for 49addc1
src/lib_json/json_value.cpp
@@ -847,9 +847,11 @@ bool Value::asBool() const {
847
return value_.int_ ? true : false;
848
case uintValue:
849
return value_.uint_ ? true : false;
850
- case realValue:
851
- // According to JavaScript language zero or NaN is regarded as false
852
- return std::fpclassify(value_.real_) != FP_ZERO && std::fpclassify(value_.real_) != FP_NAN;
+ case realValue: {
+ // According to JavaScript language zero or NaN is regarded as false
+ const auto value_classification = std::fpclassify(value_.real_);
853
+ return value_classification != FP_ZERO && value_classification != FP_NAN;
854
+ }
855
default:
856
break;
857
}
0 commit comments