Use memset instead of nested for-loop to zero a 2d array
Saves 26 bytes of flash memory and removes two 'int' types
This commit is contained in:
parent
2554d21925
commit
a54a133968
|
|
@ -10,9 +10,7 @@ mesh_bed_leveling::mesh_bed_leveling() { reset(); }
|
|||
|
||||
void mesh_bed_leveling::reset() {
|
||||
active = 0;
|
||||
for (int y = 0; y < MESH_NUM_Y_POINTS; y++)
|
||||
for (int x = 0; x < MESH_NUM_X_POINTS; x++)
|
||||
z_values[y][x] = 0;
|
||||
memset(z_values, 0, sizeof(float) * MESH_NUM_X_POINTS * MESH_NUM_Y_POINTS);
|
||||
}
|
||||
|
||||
static inline bool vec_undef(const float v[2])
|
||||
|
|
|
|||
Loading…
Reference in New Issue