mirror of
https://github.com/Detanup01/gbe_fork.git
synced 2024-12-28 03:14:15 +08:00
Small improvements
Its always better to reserve memory when we can for a vector. Also, STL implements a lot of algorithms, its better to use them in case someday you need to change it to something alike. Like reversing the copy, use transform instead, etc...
This commit is contained in:
parent
514f2ddbd9
commit
d2fba40cb4
@ -70,8 +70,8 @@ struct Steam_Inventory_Requests* new_inventory_result(bool full_query=true, cons
|
||||
request.inventory_result = result;
|
||||
request.full_query = full_query;
|
||||
if (pInstanceIDs && unCountInstanceIDs) {
|
||||
for (int i = 0; i < unCountInstanceIDs; ++i)
|
||||
request.instance_ids.push_back(pInstanceIDs[i]);
|
||||
request.instance_ids.reserve(unCountInstanceIDs);
|
||||
std::copy(pInstanceIDs, pInstanceIDs + unCountInstanceIDs, std::back_inserter(request.instance_ids));
|
||||
}
|
||||
|
||||
request.time_created = std::chrono::system_clock::now();
|
||||
|
Loading…
x
Reference in New Issue
Block a user