mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 10:08:18 +00:00
Add constructor for CSetting
and use emplace_back
This commit is contained in:
parent
1170add71e
commit
d8c05115c9
|
@ -442,6 +442,11 @@ public:
|
|||
struct CSetting
|
||||
{
|
||||
char m_aCommand[256];
|
||||
|
||||
CSetting(const char *pCommand)
|
||||
{
|
||||
str_copy(m_aCommand, pCommand);
|
||||
}
|
||||
};
|
||||
std::vector<CSetting> m_vSettings;
|
||||
|
||||
|
|
|
@ -502,9 +502,7 @@ bool CEditorMap::Load(const char *pFileName, int StorageType, const std::functio
|
|||
while(pNext < pSettings + Size)
|
||||
{
|
||||
int StrSize = str_length(pNext) + 1;
|
||||
CSetting Setting;
|
||||
str_copy(Setting.m_aCommand, pNext);
|
||||
m_vSettings.push_back(Setting);
|
||||
m_vSettings.emplace_back(pNext);
|
||||
pNext += StrSize;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue