mirror of
https://github.com/TerryCavanagh/VVVVVV.git
synced 2026-01-29 17:38:16 +03:00
Remove indentation level from checking for empty pText
Instead of checking the length() of an std::string, just check if pText[0] is equal to '\0'. This will have to be done anyway, because I'm going to get rid of the std::string allocation here, and I noticed this inefficiency in the indentation, so I'm going to remove it. The actual unindent will be done in the next commit.
This commit is contained in:
@@ -443,17 +443,14 @@ void Game::updatecustomlevelstats(std::string clevel, int cscore)
|
||||
}
|
||||
|
||||
#define LOAD_ARRAY_RENAME(ARRAY_NAME, DEST) \
|
||||
if (pKey == #ARRAY_NAME) \
|
||||
if (pKey == #ARRAY_NAME && pText[0] != '\0') \
|
||||
{ \
|
||||
std::string TextString = pText; \
|
||||
if (TextString.length()) \
|
||||
{ \
|
||||
std::vector<std::string> values = split(TextString, ','); \
|
||||
for (int i = 0; i < VVV_min(SDL_arraysize(DEST), values.size()); i++) \
|
||||
{ \
|
||||
DEST[i] = help.Int(values[i].c_str()); \
|
||||
} \
|
||||
} \
|
||||
}
|
||||
|
||||
#define LOAD_ARRAY(ARRAY_NAME) LOAD_ARRAY_RENAME(ARRAY_NAME, ARRAY_NAME)
|
||||
@@ -542,17 +539,14 @@ void Game::loadcustomlevelstats()
|
||||
|
||||
LOAD_ARRAY_RENAME(customlevelscore, customlevelscores)
|
||||
|
||||
if (pKey == "customlevelstats")
|
||||
if (pKey == "customlevelstats" && pText[0] != '\0')
|
||||
{
|
||||
std::string TextString = (pText);
|
||||
if(TextString.length())
|
||||
{
|
||||
std::vector<std::string> values = split(TextString,'|');
|
||||
for(size_t i = 0; i < values.size(); i++)
|
||||
{
|
||||
customlevelnames.push_back(values[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user