From dbdf693c812a8f57a97023e8782e928f46b1b1eb Mon Sep 17 00:00:00 2001 From: Lioncash Date: Wed, 22 Mar 2017 19:03:14 -0400 Subject: [PATCH] IniFile: Use character literals instead of string literals where applicable Character overloads are generally better overall (range checks aren't necessary, etc). --- Source/Core/Common/IniFile.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Source/Core/Common/IniFile.cpp b/Source/Core/Common/IniFile.cpp index 065d7e9b3c..1fd0f7c343 100644 --- a/Source/Core/Common/IniFile.cpp +++ b/Source/Core/Common/IniFile.cpp @@ -23,7 +23,7 @@ void IniFile::ParseLine(const std::string& line, std::string* keyOut, std::strin if (line[0] == '#') return; - size_t firstEquals = line.find("=", 0); + size_t firstEquals = line.find('='); if (firstEquals != std::string::npos) { @@ -445,7 +445,7 @@ bool IniFile::Load(const std::string& filename, bool keep_current_data) { if (line[0] == '[') { - size_t endpos = line.find("]"); + size_t endpos = line.find(']'); if (endpos != std::string::npos) { @@ -492,7 +492,7 @@ bool IniFile::Save(const std::string& filename) for (const Section& section : sections) { if (section.keys_order.size() != 0 || section.m_lines.size() != 0) - out << "[" << section.name << "]" << std::endl; + out << '[' << section.name << ']' << std::endl; if (section.keys_order.size() == 0) {