Add internal utility for zeroing int vectors.
Remove unnecessary branches in related functions. PiperOrigin-RevId: 562768873 Change-Id: I3964a7a953d95bcd4e29137a7b590be5ffa6e311
This commit is contained in:
committed by
Copybara-Service
parent
f976d6d228
commit
d5292976de
@@ -14,8 +14,6 @@
|
||||
|
||||
#include "engine/engine_support.h"
|
||||
|
||||
#include <string.h>
|
||||
|
||||
#include <mujoco/mjdata.h>
|
||||
#include <mujoco/mjmacro.h>
|
||||
#include <mujoco/mjmodel.h>
|
||||
@@ -1161,7 +1159,7 @@ void mj_copyM2DSparse(const mjModel* m, mjData* d, mjtNum* dst, const mjtNum* sr
|
||||
|
||||
// init remaining
|
||||
int* remaining = mj_stackAllocInt(d, nv);
|
||||
memcpy(remaining, d->D_rownnz, nv * sizeof(int));
|
||||
mju_copyInt(remaining, d->D_rownnz, nv);
|
||||
|
||||
// copy data
|
||||
for (int i = nv - 1; i >= 0; i--) {
|
||||
|
||||
Reference in New Issue
Block a user