Core: Clean up here and there.

*replase postfix iterator increment\decrement with prefix in cycles
*replase strlen(*char) != 0 with *char[0] != '\0'
*replase strlen(rStr.c_str()) with rStr.length()
This commit is contained in:
Chaplain
2011-08-23 18:09:08 +03:00
parent 7e1f3ceb44
commit fb27848510
13 changed files with 18 additions and 20 deletions
+2 -2
View File
@@ -239,7 +239,7 @@ inline void LoadDBC(uint32& availableDbcLocales, StoreProblemList& errors, DBCSt
if (FILE* f = fopen(dbcFilename.c_str(), "rb"))
{
char buf[100];
snprintf(buf, 100, " (exists, but has %d fields instead of " SIZEFMTD ") Possible wrong client version.", storage.GetFieldCount(), strlen(storage.GetFormat()));
snprintf(buf, 100, " (exists, but has %u fields instead of " SIZEFMTD ") Possible wrong client version.", storage.GetFieldCount(), strlen(storage.GetFormat()));
errors.push_back(dbcFilename + buf);
fclose(f);
}
@@ -363,7 +363,7 @@ void LoadDBCStores(const std::string& dataPath)
// fill data
for (uint32 i = 1; i < sMapDifficultyStore.GetNumRows(); ++i)
if (MapDifficultyEntry const* entry = sMapDifficultyStore.LookupEntry(i))
sMapDifficultyMap[MAKE_PAIR32(entry->MapId, entry->Difficulty)] = MapDifficulty(entry->resetTime, entry->maxPlayers, strlen(entry->areaTriggerText)>0);
sMapDifficultyMap[MAKE_PAIR32(entry->MapId, entry->Difficulty)] = MapDifficulty(entry->resetTime, entry->maxPlayers, entry->areaTriggerText[0] != '\0');
sMapDifficultyStore.Clear();
LoadDBC(availableDbcLocales, bad_dbc_files, sMovieStore, dbcPath, "Movie.dbc");