From 1074c87f18881ba8e6c20c1cee10ec3cbba71adb Mon Sep 17 00:00:00 2001 From: bunnei Date: Sat, 11 Jul 2020 19:28:09 -0400 Subject: [PATCH] Revert "Port citra-emu/citra#5441: "Common: remove a mod from AlignUp"" --- src/common/alignment.h | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/common/alignment.h b/src/common/alignment.h index 516bb26c1..f8c49e079 100644 --- a/src/common/alignment.h +++ b/src/common/alignment.h @@ -11,9 +11,7 @@ namespace Common { template constexpr T AlignUp(T value, std::size_t size) { static_assert(std::is_unsigned_v, "T must be an unsigned value."); - auto mod{value % size}; - value -= mod; - return static_cast(mod == T{0} ? value : value + size); + return static_cast(value + (size - value % size) % size); } template