From 33989a61e3d47dadb7fcff1bef7ece65697023d1 Mon Sep 17 00:00:00 2001 From: Michele Caini Date: Fri, 18 Mar 2022 10:49:52 +0100 Subject: [PATCH] dense_set: claen up --- src/entt/container/dense_set.hpp | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/entt/container/dense_set.hpp b/src/entt/container/dense_set.hpp index 7f4ac4b13..6c80fa9ea 100644 --- a/src/entt/container/dense_set.hpp +++ b/src/entt/container/dense_set.hpp @@ -235,10 +235,6 @@ class dense_set { using sparse_container_type = std::vector>; using packed_container_type = std::vector>; - [[nodiscard]] std::size_t hash_to_bucket(const std::size_t hash) const ENTT_NOEXCEPT { - return fast_mod(hash, bucket_count()); - } - template [[nodiscard]] auto constrained_find(const Other &value, std::size_t bucket) { for(auto it = begin(bucket), last = end(bucket); it != last; ++it) { @@ -499,8 +495,7 @@ public: template std::pair emplace(Args &&...args) { auto &node = packed.first().emplace_back(std::piecewise_construct, std::make_tuple(packed.first().size()), std::forward_as_tuple(std::forward(args)...)); - const auto hash = sparse.second()(node.second); - const auto index = hash_to_bucket(hash); + const auto index = bucket(node.second); if(auto it = constrained_find(node.second, index); it != end()) { packed.first().pop_back(); @@ -712,7 +707,7 @@ public: * @return The bucket for the given element. */ [[nodiscard]] size_type bucket(const value_type &value) const { - return hash_to_bucket(sparse.second()(value)); + return fast_mod(sparse.second()(value), bucket_count()); } /**