diff options
| author | Matthew Parlane <parlane@gmail.com> | 2014-02-13 21:10:27 +1300 |
|---|---|---|
| committer | Matthew Parlane <parlane@gmail.com> | 2014-02-13 21:10:27 +1300 |
| commit | 06329e24531b69a4856bbe05a8c89c57d9346de6 (patch) | |
| tree | d2c3cd6256b09ebdc04b8c913b21c2e56d30c2e1 /Source/Core/Common/SysConf.cpp | |
| parent | 88526be3b5cfc33436d4390935d7982c4795520a (diff) | |
| parent | 404624bf0b0125e5a408021c616ee9b9e2dde382 (diff) | |
Merge pull request #65 from Tilka/nits
Small changes
Diffstat (limited to 'Source/Core/Common/SysConf.cpp')
| -rw-r--r-- | Source/Core/Common/SysConf.cpp | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/Source/Core/Common/SysConf.cpp b/Source/Core/Common/SysConf.cpp index acfb11b0ed..6948e7db31 100644 --- a/Source/Core/Common/SysConf.cpp +++ b/Source/Core/Common/SysConf.cpp @@ -25,8 +25,7 @@ SysConf::~SysConf() void SysConf::Clear() { - for (std::vector<SSysConfEntry>::const_iterator i = m_Entries.begin(); - i < m_Entries.end() - 1; i++) + for (auto i = m_Entries.begin(); i < m_Entries.end() - 1; ++i) delete [] i->data; m_Entries.clear(); } @@ -85,8 +84,7 @@ bool SysConf::LoadFromFileInternal(FILE *fh) } // Last offset is an invalid entry. We ignore it throughout this class - for (std::vector<SSysConfEntry>::iterator i = m_Entries.begin(); - i < m_Entries.end() - 1; i++) + for (auto i = m_Entries.begin(); i < m_Entries.end() - 1; ++i) { SSysConfEntry& curEntry = *i; f.Seek(curEntry.offset, SEEK_SET); @@ -300,7 +298,7 @@ void SysConf::GenerateSysConf() items[26].data[0] = 0x01; - for (auto& item : items) + for (const SSysConfEntry& item : items) m_Entries.push_back(item); File::CreateFullPath(m_FilenameDefault); @@ -362,8 +360,7 @@ bool SysConf::SaveToFile(const char *filename) { File::IOFile f(filename, "r+b"); - for (std::vector<SSysConfEntry>::iterator i = m_Entries.begin(); - i < m_Entries.end() - 1; i++) + for (auto i = m_Entries.begin(); i < m_Entries.end() - 1; ++i) { // Seek to after the name of this entry f.Seek(i->offset + i->nameLength + 1, SEEK_SET); |
