From 765e7536b5fb8d55f35e8ef370b3d3e8bb2d7ef6 Mon Sep 17 00:00:00 2001 From: Muhammad Arif bin Mohamad Ghazaly Date: Fri, 29 Nov 2024 22:37:50 -0500 Subject: [PATCH] task 2 - 4358 --- include/nlohmann/detail/conversions/from_json.hpp | 6 +----- single_include/nlohmann/json.hpp | 6 +----- 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/include/nlohmann/detail/conversions/from_json.hpp b/include/nlohmann/detail/conversions/from_json.hpp index 522292247..ecc347d9f 100644 --- a/include/nlohmann/detail/conversions/from_json.hpp +++ b/include/nlohmann/detail/conversions/from_json.hpp @@ -378,12 +378,8 @@ inline void from_json(const BasicJsonType& j, ArithmeticType& val) val = static_cast(*j.template get_ptr()); break; } - case value_t::boolean: - { - val = static_cast(*j.template get_ptr()); - break; - } + case value_t::boolean: case value_t::null: case value_t::object: case value_t::array: diff --git a/single_include/nlohmann/json.hpp b/single_include/nlohmann/json.hpp index 02441416b..36b26baf8 100644 --- a/single_include/nlohmann/json.hpp +++ b/single_include/nlohmann/json.hpp @@ -5051,12 +5051,8 @@ inline void from_json(const BasicJsonType& j, ArithmeticType& val) val = static_cast(*j.template get_ptr()); break; } - case value_t::boolean: - { - val = static_cast(*j.template get_ptr()); - break; - } + case value_t::boolean: case value_t::null: case value_t::object: case value_t::array: