From 0952f3ce03a809de7805667ce9b279a5bcfed06d Mon Sep 17 00:00:00 2001 From: Michele Caini Date: Fri, 23 Sep 2022 10:59:23 +0200 Subject: [PATCH] view: reduce the number of symbols --- src/entt/entity/view.hpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/entt/entity/view.hpp b/src/entt/entity/view.hpp index 5fb44e3d4..a8a460f74 100644 --- a/src/entt/entity/view.hpp +++ b/src/entt/entity/view.hpp @@ -215,14 +215,16 @@ class basic_view, exclude_t> { } } + [[nodiscard]] auto reject(const underlying_type entt) const noexcept { + return std::apply([entt](const auto *...curr) { return (curr->contains(entt) || ...); }, filter); + } + template void each(Func func, std::index_sequence) const { for(const auto curr: storage().each()) { const auto entt = std::get<0>(curr); - if(((sizeof...(Get) != 1u) || (entt != tombstone)) - && ((Curr == Index || storage().contains(entt)) && ...) - && std::apply([entt](const auto *...epool) { return (!epool->contains(entt) && ...); }, filter)) { + if(((sizeof...(Get) != 1u) || (entt != tombstone)) && ((Curr == Index || storage().contains(entt)) && ...) && !reject(entt)) { if constexpr(is_applicable_v{}, std::declval().get({})))>) { std::apply(func, std::tuple_cat(std::make_tuple(entt), dispatch_get(curr)...)); } else {