diff --git a/src/entt/entity/observer.hpp b/src/entt/entity/observer.hpp index 3e12ac563..d771fcdf6 100644 --- a/src/entt/entity/observer.hpp +++ b/src/entt/entity/observer.hpp @@ -313,7 +313,7 @@ public: disconnect(); connect(reg, std::index_sequence_for{}); target = ® - view.reset(); + view.clear(); } /*! @brief Disconnects an observer from the registry it keeps track of. */ @@ -382,9 +382,9 @@ public: return view.sparse_set::end(); } - /*! @brief Resets the underlying container. */ + /*! @brief Clears the underlying container. */ void clear() ENTT_NOEXCEPT { - view.reset(); + view.clear(); } /** diff --git a/src/entt/entity/registry.hpp b/src/entt/entity/registry.hpp index ae27b78b9..d89f7a143 100644 --- a/src/entt/entity/registry.hpp +++ b/src/entt/entity/registry.hpp @@ -869,7 +869,7 @@ public: void reset() { if(auto &cpool = assure(); cpool.on_destroy().empty()) { // no group set, otherwise the signal wouldn't be empty - cpool.reset(); + cpool.clear(); } else { for(const auto entity: static_cast &>(cpool)) { cpool.remove(*this, entity); diff --git a/src/entt/entity/sparse_set.hpp b/src/entt/entity/sparse_set.hpp index e053bdcc6..4417fa346 100644 --- a/src/entt/entity/sparse_set.hpp +++ b/src/entt/entity/sparse_set.hpp @@ -617,9 +617,9 @@ public: } /** - * @brief Resets a sparse set. + * @brief Clears a sparse set. */ - void reset() ENTT_NOEXCEPT { + void clear() ENTT_NOEXCEPT { reverse.clear(); direct.clear(); } diff --git a/src/entt/entity/storage.hpp b/src/entt/entity/storage.hpp index 9311a324f..ca08880f4 100644 --- a/src/entt/entity/storage.hpp +++ b/src/entt/entity/storage.hpp @@ -468,9 +468,9 @@ public: } } - /*! @brief Resets a storage. */ - void reset() { - underlying_type::reset(); + /*! @brief Clears a storage. */ + void clear() { + underlying_type::clear(); instances.clear(); } diff --git a/test/entt/entity/sparse_set.cpp b/test/entt/entity/sparse_set.cpp index 6aaff1339..1d88add92 100644 --- a/test/entt/entity/sparse_set.cpp +++ b/test/entt/entity/sparse_set.cpp @@ -70,7 +70,7 @@ TEST(SparseSet, Functionalities) { ASSERT_FALSE(other.empty()); ASSERT_EQ(other.index(entt::entity{42}), 0u); - other.reset(); + other.clear(); ASSERT_TRUE(other.empty()); ASSERT_EQ(other.size(), 0u); diff --git a/test/entt/entity/storage.cpp b/test/entt/entity/storage.cpp index 66466e929..9f849a065 100644 --- a/test/entt/entity/storage.cpp +++ b/test/entt/entity/storage.cpp @@ -60,7 +60,7 @@ TEST(Storage, Functionalities) { ASSERT_EQ(*pool.try_get(entt::entity{41}), 12); ASSERT_EQ(pool.try_get(entt::entity{99}), nullptr); - pool.reset(); + pool.clear(); ASSERT_TRUE(pool.empty()); ASSERT_EQ(pool.size(), 0u);