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