mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-04 18:41:51 +00:00
Optimize container insertions using emplace_back instead of push_back
This commit is contained in:
parent
f25a425cb9
commit
e98fb9a1a7
9 changed files with 13 additions and 13 deletions
|
|
@ -54,7 +54,7 @@ void Inventory::deserialize(dynamic::Map* src) {
|
|||
auto slotsarr = src->list("slots");
|
||||
size_t slotscount = slotsarr->size();
|
||||
while (slots.size() < slotscount) {
|
||||
slots.push_back(ItemStack());
|
||||
slots.emplace_back();
|
||||
}
|
||||
for (size_t i = 0; i < slotscount; i++) {
|
||||
auto item = slotsarr->map(i);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue