Add internal utility for zeroing int vectors.

Remove unnecessary branches in related functions.

PiperOrigin-RevId: 562768873
Change-Id: I3964a7a953d95bcd4e29137a7b590be5ffa6e311
This commit is contained in:
Yuval Tassa
2023-09-05 07:13:37 -07:00
committed by Copybara-Service
parent f976d6d228
commit d5292976de
10 changed files with 30 additions and 31 deletions
+1 -2
View File
@@ -16,7 +16,6 @@
#include <math.h>
#include <stdio.h>
#include <string.h>
#include <mujoco/mjdata.h>
#include <mujoco/mjmacro.h>
@@ -592,7 +591,7 @@ void mju_factorLUSparse(mjtNum* LU, int n, int* scratch,
int* remaining = scratch;
// set remaining = rownnz
memcpy(remaining, rownnz, n*sizeof(int));
mju_copyInt(remaining, rownnz, n);
// diagonal elements (i,i)
for (int i=n-1; i >= 0; i--) {