diff --git a/src/ll/api/memory/PatchHelper.h b/src/ll/api/memory/PatchHelper.h index 65647295e2..9865866d74 100644 --- a/src/ll/api/memory/PatchHelper.h +++ b/src/ll/api/memory/PatchHelper.h @@ -51,11 +51,11 @@ namespace ll::memory { template struct PatchHelper { - uchar data[len]; + uchar data[len]; using ref_t = uchar (&)[len]; - constexpr bool operator==(ref_t ref) const noexcept { return memcmp(data, ref, sizeof data) == 0; } - constexpr bool operator!=(ref_t ref) const noexcept { return memcmp(data, ref, sizeof data) != 0; } - constexpr bool operator==(PatchHelper const& ref) const noexcept { + constexpr bool operator==(ref_t ref) const noexcept { return memcmp(data, ref, sizeof data) == 0; } + constexpr bool operator!=(ref_t ref) const noexcept { return memcmp(data, ref, sizeof data) != 0; } + constexpr bool operator==(PatchHelper const& ref) const noexcept { return memcmp(data, ref.data, sizeof data) == 0; } constexpr bool operator!=(PatchHelper const& ref) const noexcept { diff --git a/src/mc/common/wrapper/optional_ref.h b/src/mc/common/wrapper/optional_ref.h index a4660af112..f996d128fc 100644 --- a/src/mc/common/wrapper/optional_ref.h +++ b/src/mc/common/wrapper/optional_ref.h @@ -104,7 +104,7 @@ class optional_ref { return std::invoke(*mPtr, static_cast(args)...); } template - [[nodiscard]] constexpr decltype(auto) operator[](Arg&& index) const { + [[nodiscard]] constexpr decltype(auto) operator[](Arg && index) const { return get()[std::forward(index)]; } [[nodiscard]] constexpr decltype(auto) end() { return get().end(); }