From d63b78f0e7f806b11fc697bf0aa4fa76eddac932 Mon Sep 17 00:00:00 2001 From: Michele Caini Date: Sat, 6 Jul 2019 16:29:09 +0200 Subject: [PATCH] minor changes --- src/entt/entity/group.hpp | 4 +--- src/entt/entity/storage.hpp | 9 ++------- 2 files changed, 3 insertions(+), 10 deletions(-) diff --git a/src/entt/entity/group.hpp b/src/entt/entity/group.hpp index 30f83eb56..e75b7ad47 100644 --- a/src/entt/entity/group.hpp +++ b/src/entt/entity/group.hpp @@ -817,9 +817,7 @@ public: auto next = copy[curr]; while(curr != next) { - const auto lhs = copy[curr]; - const auto rhs = copy[next]; - (std::get *>(pools)->swap(lhs, rhs), ...); + (std::get *>(pools)->swap(copy[curr], copy[next]), ...); copy[curr] = curr; curr = next; next = copy[curr]; diff --git a/src/entt/entity/storage.hpp b/src/entt/entity/storage.hpp index 348040aab..f4af84dbf 100644 --- a/src/entt/entity/storage.hpp +++ b/src/entt/entity/storage.hpp @@ -459,10 +459,7 @@ public: auto next = copy[curr]; while(curr != next) { - const auto lhs = copy[curr]; - const auto rhs = copy[next]; - std::swap(instances[lhs], instances[rhs]); - underlying_type::swap(lhs, rhs); + swap(copy[curr], copy[next]); copy[curr] = curr; curr = next; next = copy[curr]; @@ -504,9 +501,7 @@ public: if(underlying_type::has(curr)) { if(curr != *(local + pos)) { - auto candidate = underlying_type::get(curr); - std::swap(instances[pos], instances[candidate]); - underlying_type::swap(pos, candidate); + swap(pos, underlying_type::get(curr)); } --pos;