瀏覽代碼

snapshot: avoid unnecessary lookups

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

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

@@ -37,7 +37,7 @@ class basic_snapshot {
         archive(static_cast<typename traits_type::entity_type>(sz));
         archive(static_cast<typename traits_type::entity_type>(sz));
 
 
         for(auto it = first; it != last; ++it) {
         for(auto it = first; it != last; ++it) {
-            if(reg->template all_of<Component>(*it)) {
+            if(view.contains(*it)) {
                 std::apply(archive, std::tuple_cat(std::make_tuple(*it), view.get(*it)));
                 std::apply(archive, std::tuple_cat(std::make_tuple(*it), view.get(*it)));
             }
             }
         }
         }