Jelajahi Sumber

entity: simplified to_version

Michele Caini 4 tahun lalu
induk
melakukan
cb4142a97d
1 mengubah file dengan 1 tambahan dan 2 penghapusan
  1. 1 2
      src/entt/entity/entity.hpp

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

@@ -96,8 +96,7 @@ public:
      * @return The integral representation of the version part.
      * @return The integral representation of the version part.
      */
      */
     [[nodiscard]] static constexpr version_type to_version(const value_type value) ENTT_NOEXCEPT {
     [[nodiscard]] static constexpr version_type to_version(const value_type value) ENTT_NOEXCEPT {
-        constexpr auto mask = (base_type::version_mask << base_type::entity_shift);
-        return ((to_integral(value) & mask) >> base_type::entity_shift);
+        return (to_integral(value) >> base_type::entity_shift);
     }
     }
 
 
     /**
     /**