From 4faeb5c44eb484f7618c956297614e4a33736632 Mon Sep 17 00:00:00 2001 From: Michele Caini Date: Thu, 7 Jul 2022 10:41:53 +0200 Subject: [PATCH] dispatcher: removed unused/useless code --- src/entt/signal/dispatcher.hpp | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) diff --git a/src/entt/signal/dispatcher.hpp b/src/entt/signal/dispatcher.hpp index 525803dec..cd08d5197 100644 --- a/src/entt/signal/dispatcher.hpp +++ b/src/entt/signal/dispatcher.hpp @@ -137,18 +137,6 @@ class basic_dispatcher { return static_cast &>(*ptr); } - template - [[nodiscard]] const handler_type *assure(const id_type id) const { - static_assert(std::is_same_v>, "Non-decayed types not allowed"); - auto &container = pools.first(); - - if(const auto it = container.find(id); it != container.end()) { - return static_cast *>(it->second.get()); - } - - return nullptr; - } - public: /*! @brief Allocator type. */ using allocator_type = Allocator; @@ -216,8 +204,11 @@ public: */ template size_type size(const id_type id = type_hash::value()) const noexcept { - const auto *cpool = assure(id); - return cpool ? cpool->size() : 0u; + if(auto it = pools.first().find(id); it != pools.first().cend()) { + return it->second->size(); + } + + return 0u; } /**