Michele Caini 8 years ago
parent
commit
92e6340120
1 changed files with 3 additions and 8 deletions
  1. 3 8
      src/entt/entity/registry.hpp

+ 3 - 8
src/entt/entity/registry.hpp

@@ -154,13 +154,6 @@ class Registry {
         return *handlers[vtype];
         return *handlers[vtype];
     }
     }
 
 
-    Entity candidate() const noexcept {
-        auto entity = entity_type(entities.size());
-        assert(entity < traits_type::entity_mask);
-        assert((entity >> traits_type::entity_shift) == entity_type{});
-        return entity;
-    }
-
 public:
 public:
     /*! @brief Underlying entity identifier. */
     /*! @brief Underlying entity identifier. */
     using entity_type = typename traits_type::entity_type;
     using entity_type = typename traits_type::entity_type;
@@ -414,7 +407,9 @@ public:
         entity_type entity;
         entity_type entity;
 
 
         if(available.empty()) {
         if(available.empty()) {
-            entity = candidate();
+            entity = entity_type(entities.size());
+            assert(entity < traits_type::entity_mask);
+            assert((entity >> traits_type::entity_shift) == entity_type{});
             entities.push_back(entity);
             entities.push_back(entity);
         } else {
         } else {
             entity = available.back();
             entity = available.back();