diff --git a/src/entt/container/dense_set.hpp b/src/entt/container/dense_set.hpp index 12eba276b..57148ee9c 100644 --- a/src/entt/container/dense_set.hpp +++ b/src/entt/container/dense_set.hpp @@ -271,7 +271,7 @@ class dense_set { void move_and_pop(const std::size_t pos) { if(const auto last = size() - 1u; pos != last) { - size_type *curr = sparse.first().data() + value_to_bucket(packed.first().back().second); + size_type *curr = &sparse.first()[value_to_bucket(packed.first().back().second)]; packed.first()[pos] = std::move(packed.first().back()); for(; *curr != last; curr = &packed.first()[*curr].first) {} *curr = pos; @@ -611,7 +611,7 @@ public: * @return Number of elements removed (either 0 or 1). */ size_type erase(const value_type &value) { - for(size_type *curr = sparse.first().data() + value_to_bucket(value); *curr != (std::numeric_limits::max)(); curr = &packed.first()[*curr].first) { + for(size_type *curr = &sparse.first()[value_to_bucket(value)]; *curr != (std::numeric_limits::max)(); curr = &packed.first()[*curr].first) { if(packed.second()(packed.first()[*curr].second, value)) { const auto index = *curr; *curr = packed.first()[*curr].first;