sparse_set: drop fast_compact, expect full clear

This commit is contained in:
skypjack
2023-02-02 18:27:14 +01:00
parent b7d8e01867
commit 85b1e57d8d
3 changed files with 4 additions and 12 deletions

1
TODO
View File

@@ -20,7 +20,6 @@ TODO (high prio):
* doc: exclude only views, storage entity, bump entities
* deprecate/remove registry reserve, capacity, empty, data, destroyed, release and so on
* test exclude-only views
* drop fast_compact, make clear do clear for real :)
WIP:
* get rid of observers, storage based views made them pointless - document alternatives

View File

@@ -274,13 +274,6 @@ protected:
packed[static_cast<size_type>(entt)] = std::exchange(free_list, traits_type::combine(entt, tombstone));
}
/*! @brief Compact function for empty sparse sets. */
void fast_compact() {
ENTT_ASSERT((compact(), size()) == 0u, "Non-empty set");
packed.clear();
free_list = tombstone;
}
protected:
/**
* @brief Erases entities from a sparse set.
@@ -993,6 +986,10 @@ public:
/*! @brief Clears a sparse set. */
void clear() {
pop_all();
// sanity check to avoid subtle issues due to storage classes
ENTT_ASSERT((compact(), size()) == 0u, "Non-empty set");
free_list = tombstone;
packed.clear();
}
/**

View File

@@ -367,10 +367,6 @@ protected:
std::destroy_at(std::addressof(element_at(static_cast<size_type>(first.index()))));
}
}
if constexpr(traits_type::in_place_delete) {
base_type::fast_compact();
}
}
/**