This commit is contained in:
skypjack
2026-03-16 14:29:01 +01:00
parent f79c6dbde1
commit 814a3e1404
3 changed files with 4 additions and 11 deletions

View File

@@ -402,9 +402,8 @@ public:
[[nodiscard]] std::vector<vertex> graph() const {
std::vector<vertex> adjacency_list{};
adjacency_list.reserve(vertices.size());
auto adjacency_matrix = builder.graph();
for(auto curr: adjacency_matrix.vertices()) {
for(auto adjacency_matrix = builder.graph(); auto curr: adjacency_matrix.vertices()) {
std::vector<std::size_t> in{};
std::vector<std::size_t> out{};

View File

@@ -23,9 +23,7 @@ namespace internal {
template<typename Registry>
void orphans(Registry &registry) {
auto &storage = registry.template storage<typename Registry::entity_type>();
for(auto entt: storage) {
for(auto &storage = registry.template storage<typename Registry::entity_type>(); auto entt: storage) {
if(registry.orphan(entt)) {
storage.erase(entt);
}

View File

@@ -194,9 +194,7 @@ class basic_sparse_set {
}
void release_sparse_pages() {
auto page_allocator{packed.get_allocator()};
for(auto &&page: sparse) {
for(auto page_allocator{packed.get_allocator()}; auto &&page: sparse) {
if(page != nullptr) {
std::destroy(page, page + traits_type::page_size);
alloc_traits::deallocate(page_allocator, page, traits_type::page_size);
@@ -534,11 +532,9 @@ public:
virtual void shrink_to_fit() {
sparse_container_type other{sparse.get_allocator()};
const auto len = sparse.size();
size_type cnt{};
other.reserve(len);
for(auto &&elem: std::as_const(packed)) {
for(size_type cnt{}; auto &&elem: std::as_const(packed)) {
if(elem != tombstone) {
if(const auto page = pos_to_page(entity_to_pos(elem)); sparse[page] != nullptr) {
if(const auto sz = page + 1u; sz > other.size()) {