sparse_set: review sort_n

This commit is contained in:
Michele Caini
2021-02-12 15:47:52 +01:00
parent a8d95b284d
commit 1c794591b9

View File

@@ -511,11 +511,14 @@ public:
auto next = index(packed[curr]);
while(curr != next) {
swap_at(next, index(packed[next]));
sparse[page(packed[curr])][offset(packed[curr])] = entity_type{static_cast<typename traits_type::entity_type>(curr)};
const auto idx = index(packed[next]);
const auto entt = packed[curr];
swap_at(next, idx);
sparse[page(entt)][offset(entt)] = entity_type{static_cast<typename traits_type::entity_type>(curr)};
curr = next;
next = index(packed[curr]);
next = idx;
}
}
}