group: refine group ::find function

This commit is contained in:
Michele Caini
2023-04-21 15:32:10 +02:00
parent 6f32225736
commit 422fd284e7

View File

@@ -479,8 +479,7 @@ public:
* iterator otherwise.
*/
[[nodiscard]] iterator find(const entity_type entt) const noexcept {
const auto it = *this ? handle().find(entt) : iterator{};
return it != end() && *it == entt ? it : end();
return *this ? handle().find(entt) : iterator{};
}
/**
@@ -897,7 +896,7 @@ public:
*/
[[nodiscard]] iterator find(const entity_type entt) const noexcept {
const auto it = *this ? handle().find(entt) : iterator{};
return it != end() && it >= begin() && *it == entt ? it : end();
return it >= begin() ? it : iterator{};
}
/**