diff options
author | Morph <39850852+Morph1984@users.noreply.github.com> | 2021-08-21 16:27:36 +0200 |
---|---|---|
committer | Morph <39850852+Morph1984@users.noreply.github.com> | 2021-08-27 08:10:58 +0200 |
commit | a32a7dacf459e0730e7c1587c99d60c411c5f8b3 (patch) | |
tree | 7c1ab8ee811ae32c08dfb438c07667516d5a6420 /src/core/network | |
parent | Merge pull request #6870 from yzct12345/trace-back-stack-back-stack-back (diff) | |
download | yuzu-a32a7dacf459e0730e7c1587c99d60c411c5f8b3.tar yuzu-a32a7dacf459e0730e7c1587c99d60c411c5f8b3.tar.gz yuzu-a32a7dacf459e0730e7c1587c99d60c411c5f8b3.tar.bz2 yuzu-a32a7dacf459e0730e7c1587c99d60c411c5f8b3.tar.lz yuzu-a32a7dacf459e0730e7c1587c99d60c411c5f8b3.tar.xz yuzu-a32a7dacf459e0730e7c1587c99d60c411c5f8b3.tar.zst yuzu-a32a7dacf459e0730e7c1587c99d60c411c5f8b3.zip |
Diffstat (limited to 'src/core/network')
-rw-r--r-- | src/core/network/network_interface.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/core/network/network_interface.cpp b/src/core/network/network_interface.cpp index cecc9aa11..a8f41c6bc 100644 --- a/src/core/network/network_interface.cpp +++ b/src/core/network/network_interface.cpp @@ -180,11 +180,11 @@ std::vector<NetworkInterface> GetAvailableNetworkInterfaces() { #endif std::optional<NetworkInterface> GetSelectedNetworkInterface() { - const std::string& selected_network_interface = Settings::values.network_interface.GetValue(); + const auto& selected_network_interface = Settings::values.network_interface.GetValue(); const auto network_interfaces = Network::GetAvailableNetworkInterfaces(); if (network_interfaces.size() == 0) { LOG_ERROR(Network, "GetAvailableNetworkInterfaces returned no interfaces"); - return {}; + return std::nullopt; } const auto res = @@ -192,12 +192,12 @@ std::optional<NetworkInterface> GetSelectedNetworkInterface() { return iface.name == selected_network_interface; }); - if (res != network_interfaces.end()) { - return *res; - } else { + if (res == network_interfaces.end()) { LOG_ERROR(Network, "Couldn't find selected interface \"{}\"", selected_network_interface); - return {}; + return std::nullopt; } + + return *res; } } // namespace Network |