We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 7c7ccbf commit c51d718Copy full SHA for c51d718
src/lib_json/json_value.cpp
@@ -852,9 +852,11 @@ bool Value::asBool() const {
852
return value_.int_ ? true : false;
853
case uintValue:
854
return value_.uint_ ? true : false;
855
- case realValue:
856
- // According to JavaScript language zero or NaN is regarded as false
857
- 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_);
858
+ return value_classification != FP_ZERO && value_classification != FP_NAN;
859
+ }
860
default:
861
break;
862
}
0 commit comments