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

+ 3 - 5
src/entt/entity/group.hpp

@@ -839,11 +839,9 @@ public:
         }
 
         for(auto next = *length; next; --next) {
-            ([next = next-1, curr = cpool->data()[next-1]](auto *cpool) {
-                if(const auto pos = cpool->index(curr); pos != next) {
-                    cpool->swap(next, pos);
-                }
-            }(std::get<pool_type<Other> *>(pools)), ...);
+            const auto pos = next - 1;
+            const auto entt = cpool->data()[pos];
+            (std::get<pool_type<Other> *>(pools)->swap(pos, std::get<pool_type<Other> *>(pools)->index(entt)), ...);
         }
     }