Skip to content

Commit

Permalink
view: internal changes
Browse files Browse the repository at this point in the history
  • Loading branch information
skypjack committed Jul 10, 2024
1 parent 312c2b1 commit 873617f
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/entt/entity/view.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -222,9 +222,7 @@ class basic_common_view {

[[nodiscard]] auto offset() const noexcept {
ENTT_ASSERT(index != Get, "Invalid view");
const auto *view = pools[index];
const size_type len[]{view->size(), view->free_list()};
return len[view->policy() == deletion_policy::swap_only];
return (pools[index]->policy() == deletion_policy::swap_only) ? pools[index]->free_list() : pools[index]->size();
}

void unchecked_refresh() noexcept {
Expand Down

0 comments on commit 873617f

Please sign in to comment.