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:
parent
56b2f43ff8
commit
689af99220
1 changed files with 4 additions and 4 deletions
|
@ -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.
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue