summaryrefslogtreecommitdiff
path: root/Source/Core/Common/IniFile.cpp
diff options
context:
space:
mode:
authorFilip Gawin <filip.gawin@zoho.com>2019-02-12 23:47:17 +0100
committerFilip Gawin <filip.gawin@zoho.com>2019-02-13 00:03:49 +0100
commit49fe9f5db13f15460a49c5771ee0d2c6b8bfdc3c (patch)
treed5bbc9e6df9ade7cd4e6917af5cc0f286eaa91ff /Source/Core/Common/IniFile.cpp
parent363ce67459fd48253d2a38cf2528c7465db49911 (diff)
Use empty instead of size
Diffstat (limited to 'Source/Core/Common/IniFile.cpp')
-rw-r--r--Source/Core/Common/IniFile.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/Source/Core/Common/IniFile.cpp b/Source/Core/Common/IniFile.cpp
index 85fd180cd5..43bbe7b50b 100644
--- a/Source/Core/Common/IniFile.cpp
+++ b/Source/Core/Common/IniFile.cpp
@@ -265,7 +265,7 @@ bool IniFile::Load(const std::string& filename, bool keep_current_data)
}
#endif
- if (line.size() > 0)
+ if (!line.empty())
{
if (line[0] == '[')
{
@@ -288,8 +288,8 @@ bool IniFile::Load(const std::string& filename, bool keep_current_data)
// Lines starting with '$', '*' or '+' are kept verbatim.
// Kind of a hack, but the support for raw lines inside an
// INI is a hack anyway.
- if ((key == "" && value == "") ||
- (line.size() >= 1 && (line[0] == '$' || line[0] == '+' || line[0] == '*')))
+ if ((key.empty() && value.empty()) ||
+ (!line.empty() && (line[0] == '$' || line[0] == '+' || line[0] == '*')))
current_section->m_lines.push_back(line);
else
current_section->Set(key, value);
@@ -315,10 +315,10 @@ bool IniFile::Save(const std::string& filename)
for (const Section& section : sections)
{
- if (section.keys_order.size() != 0 || section.m_lines.size() != 0)
+ if (!section.keys_order.empty() || !section.m_lines.empty())
out << '[' << section.name << ']' << std::endl;
- if (section.keys_order.size() == 0)
+ if (section.keys_order.empty())
{
for (const std::string& s : section.m_lines)
out << s << std::endl;