summaryrefslogtreecommitdiffstats
path: root/src/common/alignment.h
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2020-07-12 01:28:09 +0200
committerGitHub <noreply@github.com>2020-07-12 01:28:09 +0200
commit1074c87f18881ba8e6c20c1cee10ec3cbba71adb (patch)
treef786a1f9e252b89d04664725c8b30d0c33aaa5e3 /src/common/alignment.h
parentMerge pull request #4300 from FearlessTobi/port-5441 (diff)
downloadyuzu-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 '')
-rw-r--r--src/common/alignment.h4
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>