Use resize_zeroed instead of resize then fill(0) in several places.

This commit is contained in:
Lukas Tenbrink
2025-03-14 09:26:29 +01:00
parent 7e4f6bdb59
commit f4de2cd22a
6 changed files with 7 additions and 15 deletions

View File

@@ -645,8 +645,7 @@ Array SurfaceTool::commit_to_arrays() {
case Mesh::ARRAY_BONES: {
int count = skin_weights == SKIN_8_WEIGHTS ? 8 : 4;
Vector<int> array;
array.resize(varr_len * count);
array.fill(0);
array.resize_zeroed(varr_len * count);
int *w = array.ptrw();
for (uint32_t idx = 0; idx < vertex_array.size(); idx++) {
@@ -669,8 +668,7 @@ Array SurfaceTool::commit_to_arrays() {
Vector<float> array;
int count = skin_weights == SKIN_8_WEIGHTS ? 8 : 4;
array.resize(varr_len * count);
array.fill(0.0f);
array.resize_zeroed(varr_len * count);
float *w = array.ptrw();
for (uint32_t idx = 0; idx < vertex_array.size(); idx++) {