diff --git a/include/magic_enum/magic_enum_fuse.hpp b/include/magic_enum/magic_enum_fuse.hpp index 73c876e12..7811eacc4 100644 --- a/include/magic_enum/magic_enum_fuse.hpp +++ b/include/magic_enum/magic_enum_fuse.hpp @@ -42,7 +42,7 @@ template constexpr optional fuse_one_enum(optional hash, E value) noexcept { if (hash) { if (const auto index = enum_index(value)) { - return (*hash << log2(enum_count() + 1)) | *index; + return (*hash << log2((enum_count() << 1) - 1)) | *index; } } return {};