Use string_view in BluetoothUtils::ToNumber

PiperOrigin-RevId: 537428550
This commit is contained in:
Janusz Sobczak
2023-06-02 15:51:34 -07:00
committed by Copybara-Service
parent 71558c0a5c
commit a41c96571f
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -78,7 +78,7 @@ std::string BluetoothUtils::FromNumber(std::uint64_t address) {
b(5), b(6), b(7));
}
std::uint64_t BluetoothUtils::ToNumber(std::string address) {
std::uint64_t BluetoothUtils::ToNumber(absl::string_view address) {
ByteArray binary = FromString(address);
if (binary.size() != kBluetoothMacAddressLength) {
return 0;
+1 -1
View File
@@ -40,7 +40,7 @@ class BluetoothUtils {
// Converts a MAC address from canonical format to binary
// Example: "F1:F2:F3:F4:F5:F6" ->0xF1F2F3F4F5F6
static std::uint64_t ToNumber(std::string address);
static std::uint64_t ToNumber(absl::string_view address);
// Checks if a Bluetooth MAC address is zero for every byte.
static bool IsBluetoothMacAddressUnset(