Use empty instead of size

This commit is contained in:
Filip Gawin
2019-02-12 23:47:17 +01:00
parent 363ce67459
commit 49fe9f5db1
28 changed files with 56 additions and 56 deletions

View File

@ -54,7 +54,7 @@ void LoadPatchSection(const std::string& section, std::vector<Patch>& patches, I
localIni.GetLines(enabledSectionName, &enabledLines);
for (const std::string& line : enabledLines)
{
if (line.size() != 0 && line[0] == '$')
if (!line.empty() && line[0] == '$')
{
std::string name = line.substr(1, line.size() - 1);
enabledNames.insert(name);
@ -71,13 +71,13 @@ void LoadPatchSection(const std::string& section, std::vector<Patch>& patches, I
for (std::string& line : lines)
{
if (line.size() == 0)
if (line.empty())
continue;
if (line[0] == '$')
{
// Take care of the previous code
if (currentPatch.name.size())
if (!currentPatch.name.empty())
{
patches.push_back(currentPatch);
}
@ -119,7 +119,7 @@ void LoadPatchSection(const std::string& section, std::vector<Patch>& patches, I
}
}
if (currentPatch.name.size() && currentPatch.entries.size())
if (!currentPatch.name.empty() && !currentPatch.entries.empty())
{
patches.push_back(currentPatch);
}