Don't index into it again

If the string has a value, then we can just use that since it will be equal to that of the vector.
This commit is contained in:
Kawe Mazidjatari 2023-08-08 02:19:45 +02:00
parent 822d9f2b19
commit 71652f02c7

View File

@ -952,7 +952,7 @@ int CConsole::TextEditCallback(ImGuiInputTextCallbackData* iData)
string svHistory = (m_nHistoryPos >= 0) ? m_vHistory[m_nHistoryPos] : "";
if (!svHistory.empty())
{
if (m_vHistory[m_nHistoryPos].find(' ') == string::npos)
if (svHistory.find(' ') == string::npos)
{
// Append whitespace to previous entered command if absent or no parameters where passed.
svHistory.append(" ");