From ff45c3957858cdf189b73e11550da06fe4337b8e Mon Sep 17 00:00:00 2001 From: Lioncash Date: Tue, 22 Sep 2020 17:31:53 -0400 Subject: 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. --- src/core/loader/nso.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/core/loader/nso.cpp') diff --git a/src/core/loader/nso.cpp b/src/core/loader/nso.cpp index 60373cc5f..1e70f6e11 100644 --- a/src/core/loader/nso.cpp +++ b/src/core/loader/nso.cpp @@ -76,16 +76,16 @@ std::optional AppLoader_NSO::LoadModule(Kernel::Process& process, Core::S bool should_pass_arguments, bool load_into_process, std::optional pm) { if (file.GetSize() < sizeof(NSOHeader)) { - return {}; + return std::nullopt; } NSOHeader nso_header{}; if (sizeof(NSOHeader) != file.ReadObject(&nso_header)) { - return {}; + return std::nullopt; } if (nso_header.magic != Common::MakeMagic('N', 'S', 'O', '0')) { - return {}; + return std::nullopt; } // Build program image -- cgit v1.2.3