From 6e1a77492132b62ccf2bfa3fdff6c666d02fd9d5 Mon Sep 17 00:00:00 2001 From: Michele Caini Date: Mon, 4 Apr 2022 09:46:00 +0200 Subject: [PATCH] sigh: slightly reduce instantiations --- src/entt/signal/sigh.hpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/entt/signal/sigh.hpp b/src/entt/signal/sigh.hpp index a3193680e..ffd220dd3 100644 --- a/src/entt/signal/sigh.hpp +++ b/src/entt/signal/sigh.hpp @@ -3,7 +3,6 @@ #include #include -#include #include #include #include @@ -362,7 +361,7 @@ private: template class sink> { using signal_type = sigh; - using difference_type = typename std::iterator_traits::difference_type; + using difference_type = typename signal_type::container_type::difference_type; template static void release(Type value_or_instance, void *signal) { @@ -406,7 +405,7 @@ public: const auto it = std::find(calls.cbegin(), calls.cend(), std::move(call)); sink other{*this}; - other.offset = std::distance(it, calls.cend()); + other.offset = calls.cend() - it; return other; } @@ -427,7 +426,7 @@ public: const auto it = std::find(calls.cbegin(), calls.cend(), std::move(call)); sink other{*this}; - other.offset = std::distance(it, calls.cend()); + other.offset = calls.cend() - it; return other; } @@ -460,7 +459,7 @@ public: return delegate.data() == value_or_instance; }); - other.offset = std::distance(it, calls.cend()); + other.offset = calls.cend() - it; } return other;