diff options
| author | 2022-01-24 10:58:22 -0500 | |
|---|---|---|
| committer | 2022-01-24 10:58:25 -0500 | |
| commit | b084a9bf0aeecee6e15c62cddf743ce07389a60f (patch) | |
| tree | 74bf120235a501273536364666e7504366200797 /src/input_common/drivers/udp_client.cpp | |
| parent | Merge pull request #7761 from v1993/patch-8 (diff) | |
| download | yuzu-b084a9bf0aeecee6e15c62cddf743ce07389a60f.tar.gz yuzu-b084a9bf0aeecee6e15c62cddf743ce07389a60f.tar.xz yuzu-b084a9bf0aeecee6e15c62cddf743ce07389a60f.zip | |
input_common/udp_client: Prevent unnecessary string copies
We can also remove some redundant const on the return values, since
these don't do anything
Diffstat (limited to 'src/input_common/drivers/udp_client.cpp')
| -rw-r--r-- | src/input_common/drivers/udp_client.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/input_common/drivers/udp_client.cpp b/src/input_common/drivers/udp_client.cpp index 9aaeb91be..8f27435a8 100644 --- a/src/input_common/drivers/udp_client.cpp +++ b/src/input_common/drivers/udp_client.cpp | |||
| @@ -339,7 +339,7 @@ void UDPClient::StartCommunication(std::size_t client, const std::string& host, | |||
| 339 | } | 339 | } |
| 340 | } | 340 | } |
| 341 | 341 | ||
| 342 | const PadIdentifier UDPClient::GetPadIdentifier(std::size_t pad_index) const { | 342 | PadIdentifier UDPClient::GetPadIdentifier(std::size_t pad_index) const { |
| 343 | const std::size_t client = pad_index / PADS_PER_CLIENT; | 343 | const std::size_t client = pad_index / PADS_PER_CLIENT; |
| 344 | return { | 344 | return { |
| 345 | .guid = clients[client].uuid, | 345 | .guid = clients[client].uuid, |
| @@ -348,7 +348,7 @@ const PadIdentifier UDPClient::GetPadIdentifier(std::size_t pad_index) const { | |||
| 348 | }; | 348 | }; |
| 349 | } | 349 | } |
| 350 | 350 | ||
| 351 | const Common::UUID UDPClient::GetHostUUID(const std::string host) const { | 351 | Common::UUID UDPClient::GetHostUUID(const std::string& host) const { |
| 352 | const auto ip = boost::asio::ip::address_v4::from_string(host); | 352 | const auto ip = boost::asio::ip::address_v4::from_string(host); |
| 353 | const auto hex_host = fmt::format("{:06x}", ip.to_ulong()); | 353 | const auto hex_host = fmt::format("{:06x}", ip.to_ulong()); |
| 354 | return Common::UUID{hex_host}; | 354 | return Common::UUID{hex_host}; |