Sfoglia il codice sorgente

registry: improved ::valid check

Michele Caini 2 anni fa
parent
commit
5ca2a95f36
1 ha cambiato i file con 1 aggiunte e 1 eliminazioni
  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.
      * @return True if the identifier is valid, false otherwise.
      */
      */
     [[nodiscard]] bool valid(const entity_type entt) const {
     [[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();
     }
     }
 
 
     /**
     /**