Просмотр исходного кода

registry: avoid using scoped iterators when destroying

Michele Caini 2 лет назад
Родитель
Сommit
bb57d94185
1 измененных файлов с 1 добавлено и 1 удалено
  1. 1 1
      src/entt/entity/registry.hpp

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

@@ -554,7 +554,7 @@ public:
     template<typename It>
     void destroy(It first, It last) {
         const auto to = entities.sort_as(first, last);
-        const auto from = entities.cbegin(0);
+        const auto from = entities.cend() - entities.free_list();
 
         for(auto &&curr: pools) {
             curr.second->remove(from, to);