Michele Caini 4 лет назад
Родитель
Сommit
533bc1ce94
1 измененных файлов с 4 добавлено и 4 удалено
  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());
         }
     }