Compare commits

...

2 Commits

Author SHA1 Message Date
cat
d21bc60024 Making use of std::stack instead of std::queue 2026-01-30 15:56:51 +02:00
cat
af05dfcf0d Fixed the wrong naming of Components.cpp 2026-01-30 15:56:33 +02:00
2 changed files with 4 additions and 5 deletions

View File

@@ -18,7 +18,7 @@ endif()
include(GNUInstallDirs)
add_library(${PROJECT_NAME} SHARED
"source/Systems/ECS/Component.cpp"
"source/Systems/ECS/Components.cpp"
"source/Systems/ECS/World.cpp"
"source/Systems/Logging.cpp"
"source/Systems/Random.cpp"

View File

@@ -16,7 +16,7 @@
#include <cstdint>
#include <functional>
#include <optional>
#include <queue>
#include <stack>
#include <tuple>
#include <utility>
#include <variant>
@@ -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<DualkeyHash *> hashList;
std::queue<std::size_t> graveyard;
std::stack<std::size_t> graveyard;
};
} // namespace Tourmaline::Containers
#endif