diff options
author | bunnei <bunneidev@gmail.com> | 2020-07-12 01:28:09 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-07-12 01:28:09 +0200 |
commit | 1074c87f18881ba8e6c20c1cee10ec3cbba71adb (patch) | |
tree | f786a1f9e252b89d04664725c8b30d0c33aaa5e3 /src | |
parent | Merge pull request #4300 from FearlessTobi/port-5441 (diff) | |
download | yuzu-1074c87f18881ba8e6c20c1cee10ec3cbba71adb.tar yuzu-1074c87f18881ba8e6c20c1cee10ec3cbba71adb.tar.gz yuzu-1074c87f18881ba8e6c20c1cee10ec3cbba71adb.tar.bz2 yuzu-1074c87f18881ba8e6c20c1cee10ec3cbba71adb.tar.lz yuzu-1074c87f18881ba8e6c20c1cee10ec3cbba71adb.tar.xz yuzu-1074c87f18881ba8e6c20c1cee10ec3cbba71adb.tar.zst yuzu-1074c87f18881ba8e6c20c1cee10ec3cbba71adb.zip |
Diffstat (limited to 'src')
-rw-r--r-- | src/common/alignment.h | 4 |
1 files changed, 1 insertions, 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 <typename T> constexpr T AlignUp(T value, std::size_t size) { static_assert(std::is_unsigned_v<T>, "T must be an unsigned value."); - auto mod{value % size}; - value -= mod; - return static_cast<T>(mod == T{0} ? value : value + size); + return static_cast<T>(value + (size - value % size) % size); } template <typename T> |