registry: improved ::valid check

This commit is contained in:
Michele Caini
2024-02-07 09:25:23 +01:00
parent df1968255b
commit 5ca2a95f36

View File

@@ -460,7 +460,7 @@ public:
* @return True if the identifier is valid, false otherwise.
*/
[[nodiscard]] bool valid(const entity_type entt) const {
return entities.contains(entt) && (entities.index(entt) < entities.free_list());
return static_cast<size_type>(entities.find(entt).index()) < entities.free_list();
}
/**