Browse Source

sparse_set/storage: minor changes

Michele Caini 4 years ago
parent
commit
e74e0531bd
2 changed files with 3 additions and 3 deletions
  1. 2 2
      src/entt/entity/sparse_set.hpp
  2. 1 1
      src/entt/entity/storage.hpp

+ 2 - 2
src/entt/entity/sparse_set.hpp

@@ -586,7 +586,7 @@ public:
      * @return True if the sparse set contains the entity, false otherwise.
      */
     [[nodiscard]] bool contains(const entity_type entt) const ENTT_NOEXCEPT {
-        const auto elem = sparse_ptr(entt);
+        const auto *elem = sparse_ptr(entt);
         constexpr auto cap = entity_traits::to_entity(null);
         // testing versions permits to avoid accessing the packed array
         return elem && (((~cap & entity_traits::to_integral(entt)) ^ entity_traits::to_integral(*elem)) < cap);
@@ -599,7 +599,7 @@ public:
      * version otherwise.
      */
     [[nodiscard]] version_type current(const entity_type entt) const {
-        const auto elem = sparse_ptr(entt);
+        const auto *elem = sparse_ptr(entt);
         constexpr auto fallback = entity_traits::to_version(tombstone);
         return elem ? entity_traits::to_version(*elem) : fallback;
     }

+ 1 - 1
src/entt/entity/storage.hpp

@@ -671,7 +671,7 @@ public:
     template<typename... Args>
     value_type &emplace(const entity_type entt, Args &&...args) {
         const auto pos = base_type::slot();
-        auto elem = assure_at_least(pos);
+        auto *elem = assure_at_least(pos);
         construct(elem, std::forward<Args>(args)...);
 
         ENTT_TRY {