From 04a0a071592e813d5595afd38be3fa9eeef17e9b Mon Sep 17 00:00:00 2001
From: Niels Lohmann <mail@nlohmann.me>
Date: Fri, 8 Jan 2021 11:21:03 +0100
Subject: [PATCH] :ok_hand: fix move constructor and move assignment

---
 include/nlohmann/json.hpp        | 13 -------------
 single_include/nlohmann/json.hpp |  6 ------
 2 files changed, 19 deletions(-)

diff --git a/include/nlohmann/json.hpp b/include/nlohmann/json.hpp
index 46e70d3e7..c1be2f4b1 100644
--- a/include/nlohmann/json.hpp
+++ b/include/nlohmann/json.hpp
@@ -2185,9 +2185,6 @@ class basic_json
     basic_json(basic_json&& other) noexcept
         : m_type(std::move(other.m_type)),
           m_value(std::move(other.m_value))
-#if JSON_DIAGNOSTICS
-        , m_parent(other.m_parent)
-#endif
     {
         // check that passed value is valid
         other.assert_invariant();
@@ -2261,9 +2258,6 @@ class basic_json
         using std::swap;
         swap(m_type, other.m_type);
         swap(m_value, other.m_value);
-#if JSON_DIAGNOSTICS
-        m_parent = other.m_parent;
-#endif
 
         assert_invariant();
         return *this;
@@ -3659,13 +3653,6 @@ class basic_json
             // fill up array with null values if given idx is outside range
             if (idx >= m_value.array->size())
             {
-#if JSON_DIAGNOSTICS
-                // remember array size before resizing
-                const auto previous_size = m_value.array->size();
-#endif
-
-                m_value.array->resize(idx + 1);
-
 #if JSON_DIAGNOSTICS
                 // set parent for values added above
                 for (auto i = previous_size; i <= idx; ++i)
diff --git a/single_include/nlohmann/json.hpp b/single_include/nlohmann/json.hpp
index 2f8c4a2cb..c17457dc2 100644
--- a/single_include/nlohmann/json.hpp
+++ b/single_include/nlohmann/json.hpp
@@ -18821,9 +18821,6 @@ class basic_json
     basic_json(basic_json&& other) noexcept
         : m_type(std::move(other.m_type)),
           m_value(std::move(other.m_value))
-#if JSON_DIAGNOSTICS
-        , m_parent(other.m_parent)
-#endif
     {
         // check that passed value is valid
         other.assert_invariant();
@@ -18897,9 +18894,6 @@ class basic_json
         using std::swap;
         swap(m_type, other.m_type);
         swap(m_value, other.m_value);
-#if JSON_DIAGNOSTICS
-        m_parent = other.m_parent;
-#endif
 
         assert_invariant();
         return *this;