Michele Caini 1 год назад
Родитель
Сommit
b275af5848
1 измененных файлов с 2 добавлено и 4 удалено
  1. 2 4
      src/entt/entity/view.hpp

+ 2 - 4
src/entt/entity/view.hpp

@@ -1008,10 +1008,8 @@ public:
             }
         } else if constexpr(std::is_invocable_v<Func, decltype(*storage()->begin())>) {
             if constexpr(Get::storage_policy == deletion_policy::swap_and_pop || Get::storage_policy == deletion_policy::swap_only) {
-                if(size_type len = base_type::size(); len != 0u) {
-                    for(auto last = storage()->end(), first = last - len; first != last; ++first) {
-                        func(*first);
-                    }
+                for(auto last = storage()->end(), first = last - base_type::size(); first != last; ++first) {
+                    func(*first);
                 }
             } else {
                 static_assert(Get::storage_policy == deletion_policy::in_place, "Unexpected storage policy");