diff options
| author | Lioncash <mathew1800@gmail.com> | 2020-09-22 17:31:53 -0400 |
|---|---|---|
| committer | Lioncash <mathew1800@gmail.com> | 2020-09-22 17:32:33 -0400 |
| commit | ff45c3957858cdf189b73e11550da06fe4337b8e (patch) | |
| tree | 288ff1cc4677d6511ed8cc7e1b0db20ce2d2590f /src/core/hle/service/sockets/bsd.cpp | |
| parent | c07fd2898b45032b5e4084fc49a19018ad099ba6 (diff) | |
General: Make use of std::nullopt where applicable
Allows some implementations to avoid completely zeroing out the internal
buffer of the optional, and instead only set the validity byte within
the structure.
This also makes it consistent how we return empty optionals.
Diffstat (limited to 'src/core/hle/service/sockets/bsd.cpp')
| -rw-r--r-- | src/core/hle/service/sockets/bsd.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/core/hle/service/sockets/bsd.cpp b/src/core/hle/service/sockets/bsd.cpp index 7b9dd42d8..a74be9370 100644 --- a/src/core/hle/service/sockets/bsd.cpp +++ b/src/core/hle/service/sockets/bsd.cpp @@ -497,7 +497,7 @@ std::pair<s32, Errno> BSD::PollImpl(std::vector<u8>& write_buffer, std::vector<u return {0, Errno::SUCCESS}; } - std::optional<FileDescriptor>& descriptor = file_descriptors[pollfd.fd]; + const std::optional<FileDescriptor>& descriptor = file_descriptors[pollfd.fd]; if (!descriptor) { LOG_ERROR(Service, "File descriptor handle={} is not allocated", pollfd.fd); pollfd.revents = POLL_NVAL; |
