From be18f2c3cc6a8e2ca63ee8bb38a6e39683b7183a Mon Sep 17 00:00:00 2001 From: LunaMoo Date: Thu, 30 Nov 2017 02:23:44 +0100 Subject: [PATCH] Change str.substr(x, 1) == "y" to str[x] == 'y' --- Core/CwCheat.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Core/CwCheat.cpp b/Core/CwCheat.cpp index 2aa258b0a9..e388bd7ee0 100644 --- a/Core/CwCheat.cpp +++ b/Core/CwCheat.cpp @@ -342,15 +342,15 @@ std::vector CWCheatEngine::GetCodesList() { bool validCheatLine = false; // This code is used by cheat menu which doesn't support empty names - if (line.length() >= 5 && line.substr(0, 1) == "_") { + if (line.length() >= 5 && line[0] == '_') { for (int i = 4; i < line.length(); i++) { - if (line.substr(i, 1) != " ") { + if (line[i] != ' ') { validCheatLine = true; break; } } } - if (validCheatLine || (line.length() >= 2 && line.substr(0, 2) == "//") || (line.length() >= 1 && line.substr(0, 1) == "#")) { + if (validCheatLine || (line.length() >= 2 && line[0] == '/' && line[1] == '/') || (line.length() >= 1 && line[0] == '#')) { codesList.push_back(TrimString(line)); } }