Skip to content

Commit 5762a8a

Browse files
committed
view: reuse internal functions if possible
1 parent ed4c675 commit 5762a8a

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/entt/entity/view.hpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -425,8 +425,7 @@ class basic_view<get_t<Get...>, exclude_t<Exclude...>> {
425425
* @return True if the view contains the given entity, false otherwise.
426426
*/
427427
[[nodiscard]] bool contains(const entity_type entt) const noexcept {
428-
return std::apply([entt](const auto *...curr) { return (curr->contains(entt) && ...); }, pools)
429-
&& std::apply([entt](const auto *...curr) { return (!curr->contains(entt) && ...); }, filter);
428+
return std::apply([entt](const auto *...curr) { return (curr->contains(entt) && ...); }, pools) && !reject(entt);
430429
}
431430

432431
/**

0 commit comments

Comments
 (0)