Browse Source

group: refine group ::find function

Michele Caini 2 years ago
parent
commit
422fd284e7
1 changed files with 2 additions and 3 deletions
  1. 2 3
      src/entt/entity/group.hpp

+ 2 - 3
src/entt/entity/group.hpp

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