From 3a67f78b8379899bcf57f5953f5b64d7e022a0be Mon Sep 17 00:00:00 2001 From: Crisrael Lucero Date: Tue, 6 Jun 2023 17:02:09 -0700 Subject: [PATCH] Replace dynamic_cast with reinterpret_cast PiperOrigin-RevId: 538330024 --- connections/core.cc | 4 ++-- connections/implementation/service_controller_router.cc | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/connections/core.cc b/connections/core.cc index 4db1faec..28e8686b 100644 --- a/connections/core.cc +++ b/connections/core.cc @@ -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(local_device) + ByteArray(reinterpret_cast(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(local_device) + ByteArray(reinterpret_cast(local_device) ->GetEndpointInfo()); } ConnectionRequestInfo old_info = { diff --git a/connections/implementation/service_controller_router.cc b/connections/implementation/service_controller_router.cc index fe2c2d42..fd3aad5d 100644 --- a/connections/implementation/service_controller_router.cc +++ b/connections/implementation/service_controller_router.cc @@ -387,7 +387,7 @@ void ServiceControllerRouter::RequestConnectionV3( if (v3_info.local_device.GetType() == NearbyDevice::Type::kConnectionsDevice) { endpoint_info = - dynamic_cast(v3_info.local_device) + reinterpret_cast(v3_info.local_device) .GetEndpointInfo(); }