mirror of
https://github.com/kidfromjupiter/nearby.git
synced 2026-09-16 15:36:12 -04:00
Use string_view in BluetoothUtils::ToNumber
PiperOrigin-RevId: 537428550
This commit is contained in:
committed by
Copybara-Service
parent
71558c0a5c
commit
a41c96571f
@@ -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;
|
||||
|
||||
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user