Permalink
Browse files

Change str.substr(x, 1) == "y" to str[x] == 'y'

  • Loading branch information...
LunaMoo committed Nov 30, 2017
1 parent 16057ed commit be18f2c3cc6a8e2ca63ee8bb38a6e39683b7183a
Showing with 3 additions and 3 deletions.
  1. +3 −3 Core/CwCheat.cpp
View
@@ -342,15 +342,15 @@ std::vector<std::string> 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));
}
}

0 comments on commit be18f2c

Please sign in to comment.