diff options
| author | bunnei <bunneidev@gmail.com> | 2023-08-09 21:24:31 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-08-09 21:24:31 -0700 |
| commit | 9d3a293a4ea17b60146c10e7561c0fd1219fd6c1 (patch) | |
| tree | b69936f3e53ee675de0ca21a1dffabd7e71acae0 /src/core/hle/service/sockets/nsd.cpp | |
| parent | 3d6ce9dd2b5bad115b295fb7092abc5c30a34448 (diff) | |
| parent | 1e394c6cdf1ab83c83477c19c0e736a95b86e8da (diff) | |
Merge pull request #11093 from liamwhite/result-ergonomics
core: remove ResultVal type
Diffstat (limited to 'src/core/hle/service/sockets/nsd.cpp')
| -rw-r--r-- | src/core/hle/service/sockets/nsd.cpp | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/src/core/hle/service/sockets/nsd.cpp b/src/core/hle/service/sockets/nsd.cpp index 5dfcaabb1..bac21752a 100644 --- a/src/core/hle/service/sockets/nsd.cpp +++ b/src/core/hle/service/sockets/nsd.cpp @@ -54,7 +54,7 @@ NSD::NSD(Core::System& system_, const char* name) : ServiceFramework{system_, na RegisterHandlers(functions); } -static ResultVal<std::string> ResolveImpl(const std::string& fqdn_in) { +static std::string ResolveImpl(const std::string& fqdn_in) { // The real implementation makes various substitutions. // For now we just return the string as-is, which is good enough when not // connecting to real Nintendo servers. @@ -64,13 +64,10 @@ static ResultVal<std::string> ResolveImpl(const std::string& fqdn_in) { static Result ResolveCommon(const std::string& fqdn_in, std::array<char, 0x100>& fqdn_out) { const auto res = ResolveImpl(fqdn_in); - if (res.Failed()) { - return res.Code(); - } - if (res->size() >= fqdn_out.size()) { + if (res.size() >= fqdn_out.size()) { return ResultOverflow; } - std::memcpy(fqdn_out.data(), res->c_str(), res->size() + 1); + std::memcpy(fqdn_out.data(), res.c_str(), res.size() + 1); return ResultSuccess; } |
