mirror of
https://github.com/kidfromjupiter/nearby.git
synced 2026-09-14 14:46:12 -04:00
Replace dynamic_cast with reinterpret_cast
PiperOrigin-RevId: 538330024
This commit is contained in:
committed by
Suet-fei Li
parent
b862fbf710
commit
3a67f78b83
+2
-2
@@ -233,7 +233,7 @@ void Core::StartAdvertisingV3(absl::string_view service_id,
|
||||
ByteArray local_endpoint_info;
|
||||
if (local_device.GetType() == NearbyDevice::kConnectionsDevice) {
|
||||
local_endpoint_info =
|
||||
ByteArray(dynamic_cast<const v3::ConnectionsDevice&>(local_device)
|
||||
ByteArray(reinterpret_cast<const v3::ConnectionsDevice&>(local_device)
|
||||
.GetEndpointInfo());
|
||||
}
|
||||
ConnectionRequestInfo old_info = {
|
||||
@@ -293,7 +293,7 @@ void Core::StartAdvertisingV3(absl::string_view service_id,
|
||||
const NearbyDevice* local_device = client_.GetLocalDevice();
|
||||
if (local_device->GetType() == NearbyDevice::kConnectionsDevice) {
|
||||
local_endpoint_info =
|
||||
ByteArray(dynamic_cast<const v3::ConnectionsDevice*>(local_device)
|
||||
ByteArray(reinterpret_cast<const v3::ConnectionsDevice*>(local_device)
|
||||
->GetEndpointInfo());
|
||||
}
|
||||
ConnectionRequestInfo old_info = {
|
||||
|
||||
@@ -387,7 +387,7 @@ void ServiceControllerRouter::RequestConnectionV3(
|
||||
if (v3_info.local_device.GetType() ==
|
||||
NearbyDevice::Type::kConnectionsDevice) {
|
||||
endpoint_info =
|
||||
dynamic_cast<v3::ConnectionsDevice&>(v3_info.local_device)
|
||||
reinterpret_cast<v3::ConnectionsDevice&>(v3_info.local_device)
|
||||
.GetEndpointInfo();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user