mirror of
https://github.com/Detanup01/gbe_fork.git
synced 2024-11-30 14:25:36 +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.inventory_result = result;
|
||||||
request.full_query = full_query;
|
request.full_query = full_query;
|
||||||
if (pInstanceIDs && unCountInstanceIDs) {
|
if (pInstanceIDs && unCountInstanceIDs) {
|
||||||
for (int i = 0; i < unCountInstanceIDs; ++i)
|
request.instance_ids.reserve(unCountInstanceIDs);
|
||||||
request.instance_ids.push_back(pInstanceIDs[i]);
|
std::copy(pInstanceIDs, pInstanceIDs + unCountInstanceIDs, std::back_inserter(request.instance_ids));
|
||||||
}
|
}
|
||||||
|
|
||||||
request.time_created = std::chrono::system_clock::now();
|
request.time_created = std::chrono::system_clock::now();
|
||||||
|
Loading…
Reference in New Issue
Block a user