From 3f1182515d5d790a5da13139122361b2a679796d Mon Sep 17 00:00:00 2001 From: Pagwin Date: Sat, 23 Nov 2024 23:23:35 -0500 Subject: [PATCH] wrote down suspects to keep in mind for tomorrow --- Map.hpp | 12 ++++++++++++ suspects | 3 +++ 2 files changed, 15 insertions(+) create mode 100644 suspects diff --git a/Map.hpp b/Map.hpp index e1d091f..7dbeef0 100644 --- a/Map.hpp +++ b/Map.hpp @@ -541,9 +541,21 @@ private: // 1 child else if (erasing->left) { *erasing = std::move(*erasing->left); + if (erasing->prev != nullptr) { + erasing->prev->next = erasing; + } + if (erasing->next != nullptr) { + erasing->next->prev = erasing; + } return true; } else if (erasing->right) { *erasing = std::move(*erasing->right); + if (erasing->prev != nullptr) { + erasing->prev->next = erasing; + } + if (erasing->next != nullptr) { + erasing->next->prev = erasing; + } return true; } // no children and root diff --git a/suspects b/suspects new file mode 100644 index 0000000..b5c0223 --- /dev/null +++ b/suspects @@ -0,0 +1,3 @@ +core_erase + +erase_child