Преглед изворни кода

avoid taking the position twice

Michele Caini пре 6 година
родитељ
комит
e37f84a227
1 измењених фајлова са 1 додато и 1 уклоњено
  1. 1 1
      src/entt/entity/group.hpp

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

@@ -843,7 +843,7 @@ public:
                 const auto pos = cpool->index(curr);
                 const auto pos = cpool->index(curr);
 
 
                 if(pos != next) {
                 if(pos != next) {
-                    cpool->swap(next, cpool->index(curr));
+                    cpool->swap(next, pos);
                 }
                 }
             }(std::get<pool_type<Other> *>(pools)), ...);
             }(std::get<pool_type<Other> *>(pools)), ...);
         }
         }