Browse Source

group: use ::handle internally if possible

Michele Caini 3 years ago
parent
commit
8af6fc0cc4
1 changed files with 6 additions and 6 deletions
  1. 6 6
      src/entt/entity/group.hpp

+ 6 - 6
src/entt/entity/group.hpp

@@ -702,7 +702,7 @@ public:
      * @return An iterator to the first entity of the group.
      * @return An iterator to the first entity of the group.
      */
      */
     [[nodiscard]] iterator begin() const noexcept {
     [[nodiscard]] iterator begin() const noexcept {
-        return *this ? (std::get<0>(pools)->base_type::end() - descriptor->current) : iterator{};
+        return *this ? (handle().base_type::end() - descriptor->current) : iterator{};
     }
     }
 
 
     /**
     /**
@@ -716,7 +716,7 @@ public:
      * group.
      * group.
      */
      */
     [[nodiscard]] iterator end() const noexcept {
     [[nodiscard]] iterator end() const noexcept {
-        return *this ? std::get<0>(pools)->base_type::end() : iterator{};
+        return *this ? handle().base_type::end() : iterator{};
     }
     }
 
 
     /**
     /**
@@ -728,7 +728,7 @@ public:
      * @return An iterator to the first entity of the reversed group.
      * @return An iterator to the first entity of the reversed group.
      */
      */
     [[nodiscard]] reverse_iterator rbegin() const noexcept {
     [[nodiscard]] reverse_iterator rbegin() const noexcept {
-        return *this ? std::get<0>(pools)->base_type::rbegin() : reverse_iterator{};
+        return *this ? handle().base_type::rbegin() : reverse_iterator{};
     }
     }
 
 
     /**
     /**
@@ -743,7 +743,7 @@ public:
      * reversed group.
      * reversed group.
      */
      */
     [[nodiscard]] reverse_iterator rend() const noexcept {
     [[nodiscard]] reverse_iterator rend() const noexcept {
-        return *this ? (std::get<0>(pools)->base_type::rbegin() + descriptor->current) : reverse_iterator{};
+        return *this ? (handle().base_type::rbegin() + descriptor->current) : reverse_iterator{};
     }
     }
 
 
     /**
     /**
@@ -773,7 +773,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 ? std::get<0>(pools)->find(entt) : iterator{};
+        const auto it = *this ? handle().find(entt) : iterator{};
         return it != end() && it >= begin() && *it == entt ? it : end();
         return it != end() && it >= begin() && *it == entt ? it : end();
     }
     }
 
 
@@ -800,7 +800,7 @@ public:
      * @return True if the group contains the given entity, false otherwise.
      * @return True if the group contains the given entity, false otherwise.
      */
      */
     [[nodiscard]] bool contains(const entity_type entt) const noexcept {
     [[nodiscard]] bool contains(const entity_type entt) const noexcept {
-        return *this && std::get<0>(pools)->contains(entt) && (std::get<0>(pools)->index(entt) < (descriptor->current));
+        return *this && handle().contains(entt) && (handle().index(entt) < (descriptor->current));
     }
     }
 
 
     /**
     /**