summaryrefslogtreecommitdiff
path: root/Source/Core/Common/Network.cpp
diff options
context:
space:
mode:
authorLioncash <mathew1800@gmail.com>2019-12-06 09:59:09 -0500
committerLioncash <mathew1800@gmail.com>2019-12-06 09:59:11 -0500
commit81edcca8db0bbbe9904956d7038bd1a2abdd9a87 (patch)
tree2354ff91dc919bf3110bf2351981666223bf1d1c /Source/Core/Common/Network.cpp
parentcbfacc41bab03f0171981a64fe90949bc2456d3e (diff)
Common/Network: Use std::nullopt in StringToMacAddress
Prevents unnecessary zeroing out of std::optional's internal buffer in some implementations.
Diffstat (limited to 'Source/Core/Common/Network.cpp')
-rw-r--r--Source/Core/Common/Network.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/Source/Core/Common/Network.cpp b/Source/Core/Common/Network.cpp
index 4c56eea8e7..a928e8e831 100644
--- a/Source/Core/Common/Network.cpp
+++ b/Source/Core/Common/Network.cpp
@@ -44,7 +44,7 @@ std::string MacAddressToString(const MACAddress& mac)
std::optional<MACAddress> StringToMacAddress(std::string_view mac_string)
{
if (mac_string.empty())
- return {};
+ return std::nullopt;
int x = 0;
MACAddress mac{};
@@ -68,7 +68,7 @@ std::optional<MACAddress> StringToMacAddress(std::string_view mac_string)
// nibble is a character in the MAC address, making 12 characters
// in total.
if (x / 2 != MAC_ADDRESS_SIZE)
- return {};
+ return std::nullopt;
return std::make_optional(mac);
}