From d166c026f7b010b16008db70b7fbd1207e2319cd Mon Sep 17 00:00:00 2001 From: Michele Caini Date: Wed, 17 May 2023 10:45:31 +0200 Subject: [PATCH] snapshot: minor changes --- src/entt/entity/snapshot.hpp | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/src/entt/entity/snapshot.hpp b/src/entt/entity/snapshot.hpp index 9792dc625..d84acbd93 100644 --- a/src/entt/entity/snapshot.hpp +++ b/src/entt/entity/snapshot.hpp @@ -106,11 +106,11 @@ public: if constexpr(sizeof...(Component) == 1u) { const auto view = reg->template view(); (component(archive, view.rbegin(), view.rend()), ...); - return *this; } else { (component(archive), ...); - return *this; } + + return *this; } /** @@ -537,14 +537,11 @@ public: * @return The local identifier if any, the null entity otherwise. */ [[nodiscard]] entity_type map(entity_type entt) const noexcept { - const auto it = remloc.find(entt); - entity_type other = null; - - if(it != remloc.cend()) { - other = it->second.first; + if(const auto it = remloc.find(entt); it != remloc.cend()) { + return it->second.first; } - return other; + return null; } private: