Skip to content

Commit

Permalink
view: refine ::find and internal asserts
Browse files Browse the repository at this point in the history
  • Loading branch information
skypjack committed Nov 12, 2024
1 parent 68c8fc9 commit ae58297
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
3 changes: 2 additions & 1 deletion TODO
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ TODO:
* review cmake warning about FetchContent_Populate (need .28 and EXCLUDE_FROM_ALL for FetchContent)
* after removing meta prop vectors, copy meta objects in their handles directly
* suppress -Wself-move on CI with g++13
* view and view iterator specializations for multi, single and filtered elements
* view specializations for multi, single and filtered elements
* view iterator specialization for single non-in-place storage (exclude only, no tombstone check required)
* organizer support to groups
* meta range: move id to meta objects and return plain types (?), then remove id from meta base and meta ctor too
* refine the storage fallback mechanism for views (ie alloc?)
Expand Down
8 changes: 2 additions & 6 deletions src/entt/entity/view.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -95,10 +95,7 @@ class view_iterator final {
pools{value},
filter{excl},
index{idx} {
if constexpr(storage_view_iterator) {
ENTT_ASSERT((pools[0u] == nullptr) || pools[0u]->policy() == deletion_policy::in_place, "Non in-place storage view iterator");
}

ENTT_ASSERT(!storage_view_iterator || pools[0u]->policy() == deletion_policy::in_place, "Non in-place storage view iterator");
seek_next();
}

Expand Down Expand Up @@ -852,8 +849,7 @@ class basic_storage_view {
const auto it = leading ? leading->find(entt) : iterator{};
return leading && (static_cast<size_type>(it.index()) < leading->free_list()) ? it : iterator{};
} else {
const auto it = leading ? leading->find(entt) : typename common_type::iterator{};
return iterator{it, {leading}, {}, 0u};
return leading ? iterator{leading->find(entt), {leading}, {}, 0u} : iterator{};
}
}

Expand Down

0 comments on commit ae58297

Please sign in to comment.