瀏覽代碼

storage: fixed clear_all counter

Michele Caini 3 年之前
父節點
當前提交
f3cd9d374d
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      src/entt/entity/storage.hpp

+ 1 - 1
src/entt/entity/storage.hpp

@@ -351,7 +351,7 @@ protected:
 
 
     /*! @brief Erases all entities of a storage. */
     /*! @brief Erases all entities of a storage. */
     void clear_all() override {
     void clear_all() override {
-        for(auto first = base_type::begin(); first.index() > 0; ++first) {
+        for(auto first = base_type::begin(); !(first.index() < 0); ++first) {
             const auto idx = static_cast<size_type>(first.index());
             const auto idx = static_cast<size_type>(first.index());
 
 
             if constexpr(traits_type::in_place_delete) {
             if constexpr(traits_type::in_place_delete) {