slightly faster destroy

This commit is contained in:
Michele Caini
2019-06-10 00:24:19 +02:00
parent a5a4ee4bfe
commit 8d08ffc4ae
+2 -1
View File
@@ -370,7 +370,8 @@ public:
* @param entt A valid entity identifier.
*/
void destroy(const entity_type entt) override {
std::swap(instances[underlying_type::get(entt)], instances.back());
auto other = std::move(instances.back());
instances[underlying_type::get(entt)] = std::move(other);
instances.pop_back();
underlying_type::destroy(entt);
}