:recycle: remove unnecessary if Signed-off-by: Niels Lohmann <mail@nlohmann.me>
diff --git a/include/nlohmann/detail/conversions/to_json.hpp b/include/nlohmann/detail/conversions/to_json.hpp index 3626593..23e15b0 100644 --- a/include/nlohmann/detail/conversions/to_json.hpp +++ b/include/nlohmann/detail/conversions/to_json.hpp
@@ -214,10 +214,7 @@ j.m_data.m_type = value_t::array; j.m_data.m_value = value_t::array; j.m_data.m_value.array->resize(arr.size()); - if (arr.size() > 0) - { - std::copy(std::begin(arr), std::end(arr), j.m_data.m_value.array->begin()); - } + std::copy(std::begin(arr), std::end(arr), j.m_data.m_value.array->begin()); j.set_parents(); j.assert_invariant(); }
diff --git a/single_include/nlohmann/json.hpp b/single_include/nlohmann/json.hpp index 65b3b34..04f4594 100644 --- a/single_include/nlohmann/json.hpp +++ b/single_include/nlohmann/json.hpp
@@ -6023,10 +6023,7 @@ j.m_data.m_type = value_t::array; j.m_data.m_value = value_t::array; j.m_data.m_value.array->resize(arr.size()); - if (arr.size() > 0) - { - std::copy(std::begin(arr), std::end(arr), j.m_data.m_value.array->begin()); - } + std::copy(std::begin(arr), std::end(arr), j.m_data.m_value.array->begin()); j.set_parents(); j.assert_invariant(); }