From d21bc6002487aacb56c03109641e000fb2a3c4bc Mon Sep 17 00:00:00 2001 From: cat Date: Fri, 30 Jan 2026 15:56:51 +0200 Subject: [PATCH] Making use of std::stack instead of std::queue --- headers/Containers/DualkeyMap.hpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/headers/Containers/DualkeyMap.hpp b/headers/Containers/DualkeyMap.hpp index 733c1cf..d584b18 100644 --- a/headers/Containers/DualkeyMap.hpp +++ b/headers/Containers/DualkeyMap.hpp @@ -16,7 +16,7 @@ #include #include #include -#include +#include #include #include #include @@ -53,9 +53,8 @@ public: if (graveyard.empty()) { hashList.push_back(hash); } else { - std::size_t tombstone = graveyard.front(); + hashList[graveyard.top()] = hash; graveyard.pop(); - hashList[tombstone] = hash; } return {hash->firstKey, hash->secondKey, hash->value}; @@ -221,7 +220,7 @@ private: // It makes more sense to store the individual hash std::vector hashList; - std::queue graveyard; + std::stack graveyard; }; } // namespace Tourmaline::Containers #endif