Common/Network: Make StringToMacAddress use a string_view

This function only ever reads the contents of the string in a non-owning
manner, so we can change the parameter over to being a string view.
This commit is contained in:
Lioncash
2019-12-06 09:43:42 -05:00
parent 15fc71cfcf
commit f06461d208
2 changed files with 3 additions and 2 deletions

View File

@ -43,7 +43,7 @@ std::string MacAddressToString(const MACAddress& mac)
mac[4], mac[5]);
}
std::optional<MACAddress> StringToMacAddress(const std::string& mac_string)
std::optional<MACAddress> StringToMacAddress(std::string_view mac_string)
{
if (mac_string.empty())
return {};