diff options
| author | 2020-09-22 23:37:51 +0000 | |
|---|---|---|
| committer | 2020-09-22 23:37:51 +0000 | |
| commit | 2b863c9aa34e388f6c64665a2e7d8c808d598c26 (patch) | |
| tree | 288ff1cc4677d6511ed8cc7e1b0db20ce2d2590f /src/core/file_sys/vfs.cpp | |
| parent | Merge pull request #4697 from lioncash/copy5 (diff) | |
| parent | General: Make use of std::nullopt where applicable (diff) | |
| download | yuzu-2b863c9aa34e388f6c64665a2e7d8c808d598c26.tar.gz yuzu-2b863c9aa34e388f6c64665a2e7d8c808d598c26.tar.xz yuzu-2b863c9aa34e388f6c64665a2e7d8c808d598c26.zip | |
Merge pull request #4698 from lioncash/optional-null
General: Make use of std::nullopt where applicable
Diffstat (limited to 'src/core/file_sys/vfs.cpp')
| -rw-r--r-- | src/core/file_sys/vfs.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/core/file_sys/vfs.cpp b/src/core/file_sys/vfs.cpp index a4c3f67c4..b2f026b6d 100644 --- a/src/core/file_sys/vfs.cpp +++ b/src/core/file_sys/vfs.cpp | |||
| @@ -169,11 +169,12 @@ VfsDirectory::~VfsDirectory() = default; | |||
| 169 | 169 | ||
| 170 | std::optional<u8> VfsFile::ReadByte(std::size_t offset) const { | 170 | std::optional<u8> VfsFile::ReadByte(std::size_t offset) const { |
| 171 | u8 out{}; | 171 | u8 out{}; |
| 172 | std::size_t size = Read(&out, 1, offset); | 172 | const std::size_t size = Read(&out, sizeof(u8), offset); |
| 173 | if (size == 1) | 173 | if (size == 1) { |
| 174 | return out; | 174 | return out; |
| 175 | } | ||
| 175 | 176 | ||
| 176 | return {}; | 177 | return std::nullopt; |
| 177 | } | 178 | } |
| 178 | 179 | ||
| 179 | std::vector<u8> VfsFile::ReadBytes(std::size_t size, std::size_t offset) const { | 180 | std::vector<u8> VfsFile::ReadBytes(std::size_t size, std::size_t offset) const { |