sparse_set: drop fast_compact, expect full clear
This commit is contained in:
1
TODO
1
TODO
@@ -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
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user