registry: review destroy to use sort_as

This commit is contained in:
Michele Caini
2024-01-25 08:28:58 +01:00
parent b96631c486
commit bba8b6bdd8

View File

@@ -556,10 +556,8 @@ public:
*/
template<typename It>
void destroy(It first, It last) {
entities.sort_as(first, last);
const auto to = entities.sort_as(first, last);
const auto from = entities.cbegin(0);
const auto to = from + std::distance(first, last);
for(auto &&curr: pools) {
curr.second->remove(from, to);