entity: simplified to_version

This commit is contained in:
Michele Caini
2021-11-30 07:59:13 +01:00
parent 80d08d5a34
commit cb4142a97d

View File

@@ -96,8 +96,7 @@ public:
* @return The integral representation of the version part.
*/
[[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);
}
/**