|
|
@@ -885,11 +885,8 @@ public:
|
|
|
template<typename... Component>
|
|
|
void clear() {
|
|
|
if constexpr(sizeof...(Component) == 0) {
|
|
|
- for(auto pos = entities.size(); pos; --pos) {
|
|
|
- if(const auto entt = entities[pos - 1]; (to_integral(entt) & traits_type::entity_mask) == (pos - 1)) {
|
|
|
- destroy(entt);
|
|
|
- }
|
|
|
- }
|
|
|
+ // useless this-> used to suppress a warning with clang
|
|
|
+ each([this](const auto entity) { this->destroy(entity); });
|
|
|
} else {
|
|
|
([this](auto *cpool) {
|
|
|
cpool->remove(*this, cpool->basic_sparse_set<entity_type>::begin(), cpool->basic_sparse_set<entity_type>::end());
|