mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2024-11-14 13:27:45 -07:00
Common/Network: Use std::nullopt in StringToMacAddress
Prevents unnecessary zeroing out of std::optional's internal buffer in some implementations.
This commit is contained in:
parent
cbfacc41ba
commit
81edcca8db
@ -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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user