group: faster contains

This commit is contained in:
Michele Caini
2019-12-27 01:43:16 +01:00
parent cd4bcce70f
commit 5a3effaef5

View File

@@ -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));
}
/**