diff --git a/src/entt/entity/sparse_set.hpp b/src/entt/entity/sparse_set.hpp index 5009f4338..e794168c5 100644 --- a/src/entt/entity/sparse_set.hpp +++ b/src/entt/entity/sparse_set.hpp @@ -749,15 +749,6 @@ public: return static_cast(traits_type::to_entity(sparse_ref(entt))); } - /** - * @brief Returns the entity at specified location, with bounds checking. - * @param pos The position for which to return the entity. - * @return The entity at specified location if any, a null entity otherwise. - */ - [[deprecated("use .begin()[pos] instead")]] [[nodiscard]] entity_type at(const size_type pos) const noexcept { - return pos < packed.size() ? packed[pos] : null; - } - /** * @brief Returns the entity at specified location, without bounds checking. * @param pos The position for which to return the entity. diff --git a/test/entt/entity/sparse_set.cpp b/test/entt/entity/sparse_set.cpp index 1e9cf43fe..63ea7ae40 100644 --- a/test/entt/entity/sparse_set.cpp +++ b/test/entt/entity/sparse_set.cpp @@ -951,23 +951,12 @@ TYPED_TEST(SparseSet, Indexing) { for(const auto policy: this->deletion_policy) { sparse_set_type set{policy}; - ASSERT_EQ(set.size(), 0u); + const std::array entity{entity_type{1}, entity_type{2}}; - ASSERT_EQ(set.at(0u), static_cast(entt::null)); // NOLINT - ASSERT_EQ(set.at(3u), static_cast(entt::null)); // NOLINT + set.push(entity.begin(), entity.end()); - const entity_type entity{1}; - const entity_type other{2}; - - set.push(entity); - set.push(other); - - ASSERT_EQ(set.size(), 2u); - - ASSERT_EQ(set.at(0u), entity); // NOLINT - ASSERT_EQ(set.at(1u), other); // NOLINT - - ASSERT_EQ(set.at(2u), static_cast(entt::null)); // NOLINT + ASSERT_EQ(set[0u], entity[0u]); + ASSERT_EQ(set[1u], entity[1u]); } }