summaryrefslogtreecommitdiff
path: root/Source/Core/Common/SysConf.cpp
diff options
context:
space:
mode:
authorLioncash <mathew1800@gmail.com>2016-08-06 16:02:44 -0400
committerLioncash <mathew1800@gmail.com>2016-08-06 16:10:48 -0400
commit58b871e05c42c54394101487d05668296f427a6e (patch)
tree030d11390495b8fc36d422954513a5e40872fe6b /Source/Core/Common/SysConf.cpp
parentfacf02686a542e7250fb01f97a4e6159a8aae41d (diff)
SysConf: Simplify entry generation
Just use a vector and move it instead of manually pushing them one-by-one.
Diffstat (limited to 'Source/Core/Common/SysConf.cpp')
-rw-r--r--Source/Core/Common/SysConf.cpp7
1 files changed, 2 insertions, 5 deletions
diff --git a/Source/Core/Common/SysConf.cpp b/Source/Core/Common/SysConf.cpp
index 9ad5894eba..2c9e3e5347 100644
--- a/Source/Core/Common/SysConf.cpp
+++ b/Source/Core/Common/SysConf.cpp
@@ -206,8 +206,7 @@ void SysConf::GenerateSysConf()
strncpy(s_Header.version, "SCv0", 4);
s_Header.numEntries = Common::swap16(28 - 1);
- SSysConfEntry items[27];
- memset(items, 0, sizeof(SSysConfEntry) * 27);
+ std::vector<SSysConfEntry> items(27);
// version length + size of numEntries + 28 * size of offset
unsigned int current_offset = 4 + 2 + 28 * 2;
@@ -325,9 +324,6 @@ void SysConf::GenerateSysConf()
current_offset += create_item(items[26], Type_Bool, "MPLS.MOVIE", 1, current_offset);
items[26].data[0] = 0x01;
- for (const SSysConfEntry& item : items)
- m_Entries.push_back(item);
-
File::CreateFullPath(m_FilenameDefault);
File::IOFile g(m_FilenameDefault, "wb");
@@ -380,6 +376,7 @@ void SysConf::GenerateSysConf()
// Write the footer
g.WriteBytes("SCed", 4);
+ m_Entries = std::move(items);
m_Filename = m_FilenameDefault;
m_IsValid = true;
}