Browse Source

registry: improved ::valid check

Michele Caini 2 years ago
parent
commit
5ca2a95f36
1 changed files with 1 additions and 1 deletions
  1. 1 1
      src/entt/entity/registry.hpp

+ 1 - 1
src/entt/entity/registry.hpp

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