Engine: fix string bug, extraneous copy

request.requestmsg() returns a reference but we assign the reference to a char*. Removed the c_str() call.
This commit is contained in:
Kawe Mazidjatari 2024-04-01 01:02:59 +02:00
parent 999ce009a8
commit 02d0ba918c

View File

@ -510,7 +510,7 @@ bool CRConServer::ProcessMessage(const char* pMsgBuf, const int nMsgLen)
//-----------------------------------------------------------------------------
void CRConServer::Execute(const cl_rcon::request& request) const
{
const string& commandString = request.requestmsg().c_str();
const string& commandString = request.requestmsg();
const char* const pCommandString = commandString.c_str();
ConCommandBase* pCommandBase = g_pCVar->FindCommandBase(pCommandString);