mirror of
https://github.com/minetest/minetest.git
synced 2024-07-02 14:10:33 +02:00
Preallocate the indices vector
This commit is contained in:
parent
da722a833f
commit
b95dcb7e7a
@ -275,8 +275,9 @@ std::optional<std::vector<u16>> CGLTFMeshFileLoader::MeshExtractor::getIndices(
|
||||
|
||||
const auto& buf = getBuffer(accessorIdx.value());
|
||||
|
||||
std::vector<u16> indices{};
|
||||
std::vector<u16> indices;
|
||||
const auto count = getElemCount(accessorIdx.value());
|
||||
indices.reserve(count);
|
||||
for (std::size_t i = 0; i < count; ++i) {
|
||||
std::size_t elemIdx = count - i - 1; // reverse index order
|
||||
u16 index;
|
||||
|
Loading…
Reference in New Issue
Block a user