Remove unnecessary copy of a big data structure

This commit is contained in:
cosin15 2024-04-23 19:03:50 +02:00 committed by GitHub
parent 58eccc7a2a
commit 15b569fb71
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -73,7 +73,7 @@ struct MapEditEvent
modified_blocks.push_back(getNodeBlockPos(pos));
}
void setModifiedBlocks(const std::map<v3s16, MapBlock *> blocks)
void setModifiedBlocks(const std::map<v3s16, MapBlock *>& blocks)
{
assert(modified_blocks.empty()); // only meant for initialization (once)
modified_blocks.reserve(blocks.size());