sparse_set/storage: ::reset is now ::clear
This commit is contained in:
@@ -313,7 +313,7 @@ public:
|
||||
disconnect();
|
||||
connect<Matcher...>(reg, std::index_sequence_for<Matcher...>{});
|
||||
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<entity_type>::end();
|
||||
}
|
||||
|
||||
/*! @brief Resets the underlying container. */
|
||||
/*! @brief Clears the underlying container. */
|
||||
void clear() ENTT_NOEXCEPT {
|
||||
view.reset();
|
||||
view.clear();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -869,7 +869,7 @@ public:
|
||||
void reset() {
|
||||
if(auto &cpool = assure<Component>(); 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<const sparse_set<entity_type> &>(cpool)) {
|
||||
cpool.remove(*this, entity);
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user