Skip to content

Commit

Permalink
snpashot: review/cleanup orphans but keep it in place
Browse files Browse the repository at this point in the history
  • Loading branch information
skypjack committed Aug 19, 2023
1 parent b87b8cf commit b1e47fc
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
1 change: 0 additions & 1 deletion TODO
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ TODO (high prio):
* resource cache: avoid using shared ptr with loader and the others
* further optimize exclusion lists in multi type views (no existence check)
* doc: bump entities
* deprecate/drop snapshot orphans function, make it a general purpose one
* view with entity storage: begin/end should return filtered iterators
* update view doc: single vs multi type views are no longer a thing actually
* meta container: add value type to resize
Expand Down
6 changes: 3 additions & 3 deletions src/entt/entity/snapshot.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@ namespace internal {

template<typename Registry>
void orphans(Registry &registry) {
auto view = registry.template view<typename Registry::entity_type>();
auto &storage = registry.template storage<typename Registry::entity_type>();

for(auto entt: view) {
for(auto entt: storage) {
if(registry.orphan(entt)) {
view.storage()->erase(entt);
storage.erase(entt);
}
}
}
Expand Down

0 comments on commit b1e47fc

Please sign in to comment.