1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-23 06:44:38 +01:00

Refactor to use push_back more efficient (#13726)

This commit is contained in:
skdltmxn
2021-01-09 05:59:55 +09:00
committed by GitHub
parent d53a94861d
commit b0a8ebc808
37 changed files with 71 additions and 88 deletions

View File

@@ -105,7 +105,7 @@ std::vector<ObjectEntryDescriptor> SceneryGroupObject::ReadItems(IStream* stream
{
stream->Seek(-1, STREAM_SEEK_CURRENT);
auto entry = stream->ReadValue<rct_object_entry>();
items.push_back(ObjectEntryDescriptor(entry));
items.emplace_back(entry);
}
return items;
}
@@ -170,10 +170,9 @@ std::vector<ObjectEntryDescriptor> SceneryGroupObject::ReadJsonEntries(json_t& j
{
std::vector<ObjectEntryDescriptor> entries;
for (auto& jEntry : jEntries)
for (const auto& jEntry : jEntries)
{
auto entry = ObjectEntryDescriptor(Json::GetString(jEntry));
entries.push_back(entry);
entries.emplace_back(Json::GetString(jEntry));
}
return entries;
}