Explorar el Código

sparse_set: review ::clear

Michele Caini hace 4 años
padre
commit
533bc1ce94
Se han modificado 1 ficheros con 4 adiciones y 4 borrados
  1. 4 4
      src/entt/entity/sparse_set.hpp

+ 4 - 4
src/entt/entity/sparse_set.hpp

@@ -902,13 +902,13 @@ public:
 
     /*! @brief Clears a sparse set. */
     void clear() {
-        if(mode == deletion_policy::in_place) {
+        if(free_list == null) {
+            try_erase(begin(), size());
+        } else {
             for(auto &&entity: *this) {
-                // honor the modality and filter all tombstones
+                // tombstone filter
                 remove(entity);
             }
-        } else {
-            try_erase(begin(), size());
         }
     }