Skip to content

Commit c51d718

Browse files
cmlchenbaylesj
cmlchen
authored andcommitted
extract variable
1 parent 7c7ccbf commit c51d718

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

Diff for: src/lib_json/json_value.cpp

+5-3
Original file line numberDiff line numberDiff line change
@@ -852,9 +852,11 @@ bool Value::asBool() const {
852852
return value_.int_ ? true : false;
853853
case uintValue:
854854
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;
855+
case realValue: {
856+
// According to JavaScript language zero or NaN is regarded as false
857+
const auto value_classification = std::fpclassify(value_.real_);
858+
return value_classification != FP_ZERO && value_classification != FP_NAN;
859+
}
858860
default:
859861
break;
860862
}

0 commit comments

Comments
 (0)