From 71652f02c7c2a9bf3f980d57436a80288d9f44d7 Mon Sep 17 00:00:00 2001 From: Kawe Mazidjatari <48657826+Mauler125@users.noreply.github.com> Date: Tue, 8 Aug 2023 02:19:45 +0200 Subject: [PATCH] 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. --- r5dev/gameui/IConsole.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/r5dev/gameui/IConsole.cpp b/r5dev/gameui/IConsole.cpp index 4370a583..f7e39640 100644 --- a/r5dev/gameui/IConsole.cpp +++ b/r5dev/gameui/IConsole.cpp @@ -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(" ");