From ccaa490a2f5405c6412fb97161a333d9dac3b581 Mon Sep 17 00:00:00 2001 From: Michele Caini Date: Mon, 27 Dec 2021 15:54:49 +0100 Subject: [PATCH] registry: removed unnecessary dispatching from non-const try_ctx --- src/entt/entity/registry.hpp | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/entt/entity/registry.hpp b/src/entt/entity/registry.hpp index 39cfb8ad1..43afdd3b2 100644 --- a/src/entt/entity/registry.hpp +++ b/src/entt/entity/registry.hpp @@ -1497,12 +1497,8 @@ public: /*! @copydoc try_ctx */ template [[nodiscard]] Type *try_ctx() { - if constexpr(std::is_const_v) { - return std::as_const(*this).template try_ctx(); - } else { - auto it = vars.find(type_hash>>::value()); - return it == vars.end() ? nullptr : any_cast(&it->second); - } + auto it = vars.find(type_hash>>::value()); + return it == vars.end() ? nullptr : any_cast(&it->second); } /**