1
0
Эх сурвалжийг харах

registry: review destroy to use sort_as

Michele Caini 2 жил өмнө
parent
commit
bba8b6bdd8

+ 1 - 3
src/entt/entity/registry.hpp

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