cleanup
This commit is contained in:
@@ -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{};
|
||||
|
||||
|
||||
@@ -23,9 +23,7 @@ namespace internal {
|
||||
|
||||
template<typename Registry>
|
||||
void orphans(Registry ®istry) {
|
||||
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);
|
||||
}
|
||||
|
||||
@@ -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()) {
|
||||
|
||||
Reference in New Issue
Block a user