view: drop pointless check

This commit is contained in:
Michele Caini
2024-09-10 15:46:08 +02:00
parent 5ecd5739d0
commit dc7ab63b6f

View File

@@ -268,8 +268,8 @@ protected:
[[nodiscard]] const Type *storage(const std::size_t pos) const noexcept {
if(pos < Get) {
return pools[pos];
} else if(filter[pos - Get] != internal::view_placeholder<Type>()) {
return filter[pos - Get];
} else if(const auto idx = pos - Get; filter[idx] != internal::view_placeholder<Type>()) {
return filter[idx];
}
return nullptr;
@@ -280,7 +280,8 @@ protected:
pools[pos] = elem;
refresh();
} else {
filter[pos - Get] = (elem == nullptr) ? internal::view_placeholder<Type>() : elem;
ENTT_ASSERT(elem != nullptr, "Unexpected element");
filter[pos - Get] = elem;
}
}