mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 22:29:39 -06:00
TraversalClient: Make use of std::string_view with ConnectToClient()
Same behavior, but allows the use of non-allocating string types with the interface.
This commit is contained in:
@ -73,7 +73,7 @@ static ENetAddress MakeENetAddress(const TraversalInetAddress& address)
|
||||
return eaddr;
|
||||
}
|
||||
|
||||
void TraversalClient::ConnectToClient(const std::string& host)
|
||||
void TraversalClient::ConnectToClient(std::string_view host)
|
||||
{
|
||||
if (host.size() > sizeof(TraversalHostId))
|
||||
{
|
||||
@ -82,7 +82,7 @@ void TraversalClient::ConnectToClient(const std::string& host)
|
||||
}
|
||||
TraversalPacket packet = {};
|
||||
packet.type = TraversalPacketType::ConnectPlease;
|
||||
memcpy(packet.connectPlease.hostId.data(), host.c_str(), host.size());
|
||||
memcpy(packet.connectPlease.hostId.data(), host.data(), host.size());
|
||||
m_ConnectRequestId = SendTraversalPacket(packet);
|
||||
m_PendingConnect = true;
|
||||
}
|
||||
|
Reference in New Issue
Block a user