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

+ 3 - 6
src/entt/entity/mixin.hpp

@@ -48,16 +48,13 @@ class sigh_mixin final: public Type {
         if(!destruction.empty()) {
             ENTT_ASSERT(owner != nullptr, "Invalid pointer to registry");
 
-            const auto view = Type::each();
-            const auto last = view.end().base();
-
-            for(auto first = view.begin().base(); first != last; ++first) {
+            for(auto pos = Type::each().begin().base().index(); !(pos < 0); --pos) {
                 if constexpr(Type::traits_type::in_place_delete) {
-                    if(const auto entt = *first; entt != tombstone) {
+                    if(const auto entt = Type::operator[](static_cast<typename Type::size_type>(pos)); entt != tombstone) {
                         destruction.publish(*owner, entt);
                     }
                 } else {
-                    destruction.publish(*owner, *first);
+                    destruction.publish(*owner, Type::operator[](static_cast<typename Type::size_type>(pos)));
                 }
             }
         }