From 5a3effaef5c7894bac2dfa89da7f0f6dab96cc33 Mon Sep 17 00:00:00 2001 From: Michele Caini Date: Fri, 27 Dec 2019 01:43:16 +0100 Subject: [PATCH] group: faster contains --- src/entt/entity/group.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/entt/entity/group.hpp b/src/entt/entity/group.hpp index d83d1d985..ccc77e31d 100644 --- a/src/entt/entity/group.hpp +++ b/src/entt/entity/group.hpp @@ -263,7 +263,7 @@ public: * @return True if the group contains the given entity, false otherwise. */ bool contains(const entity_type entt) const { - return find(entt) != end(); + return handler->has(entt); } /** @@ -682,7 +682,7 @@ public: * @return True if the group contains the given entity, false otherwise. */ bool contains(const entity_type entt) const { - return find(entt) != end(); + return std::get<0>(pools)->has(entt) && (std::get<0>(pools)->index(entt) < (*length)); } /**