1
0
Fork 0
mirror of https://github.com/TerryCavanagh/VVVVVV.git synced 2025-01-22 08:49:46 +01:00

Make currentletter a char instead of an std::string

It's only one character... why does it have to be a fully-fledged
std::string?
This commit is contained in:
Misa 2020-07-02 16:04:51 -07:00 committed by Ethan Lee
parent 56b2f43ff8
commit 689af99220

View file

@ -38,19 +38,19 @@ void scriptclass::tokenize( std::string t )
{ {
j = 0; j = 0;
std::string tempword; std::string tempword;
std::string currentletter; char currentletter;
for (size_t i = 0; i < t.length(); i++) for (size_t i = 0; i < t.length(); i++)
{ {
currentletter = t.substr(i, 1); currentletter = t[i];
if (currentletter == "(" || currentletter == ")" || currentletter == ",") if (currentletter == '(' || currentletter == ')' || currentletter == ',')
{ {
words[j] = tempword; words[j] = tempword;
std::transform(words[j].begin(), words[j].end(), words[j].begin(), ::tolower); std::transform(words[j].begin(), words[j].end(), words[j].begin(), ::tolower);
j++; j++;
tempword = ""; tempword = "";
} }
else if (currentletter == " ") else if (currentletter == ' ')
{ {
//don't do anything - i.e. strip out spaces. //don't do anything - i.e. strip out spaces.
} }