summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLioncash <mathew1800@gmail.com>2018-07-21 04:02:53 +0200
committerLioncash <mathew1800@gmail.com>2018-07-21 04:04:37 +0200
commit3e0727df1b9354952dc7690dddd3a8239bcdadda (patch)
tree338abfd6af45e7adbe190f51d268c02940415b86
parentvfs: Make WriteBytes() overload taking a std::vector pass the std::vector by const reference (diff)
downloadyuzu-3e0727df1b9354952dc7690dddd3a8239bcdadda.tar
yuzu-3e0727df1b9354952dc7690dddd3a8239bcdadda.tar.gz
yuzu-3e0727df1b9354952dc7690dddd3a8239bcdadda.tar.bz2
yuzu-3e0727df1b9354952dc7690dddd3a8239bcdadda.tar.lz
yuzu-3e0727df1b9354952dc7690dddd3a8239bcdadda.tar.xz
yuzu-3e0727df1b9354952dc7690dddd3a8239bcdadda.tar.zst
yuzu-3e0727df1b9354952dc7690dddd3a8239bcdadda.zip
-rw-r--r--src/core/file_sys/vfs_offset.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/core/file_sys/vfs_offset.cpp b/src/core/file_sys/vfs_offset.cpp
index 38ec4e0f9..217e02235 100644
--- a/src/core/file_sys/vfs_offset.cpp
+++ b/src/core/file_sys/vfs_offset.cpp
@@ -2,6 +2,7 @@
// Licensed under GPLv2 or any later version
// Refer to the license.txt file included.
+#include <algorithm>
#include <utility>
#include "core/file_sys/vfs_offset.h"
@@ -88,7 +89,7 @@ size_t OffsetVfsFile::GetOffset() const {
}
size_t OffsetVfsFile::TrimToFit(size_t r_size, size_t r_offset) const {
- return std::max<size_t>(std::min<size_t>(size - r_offset, r_size), 0);
+ return std::clamp(r_size, size_t{0}, size - r_offset);
}
} // namespace FileSys