Avoid unnecessary copies after of mju_mulQuat.

Since fdbbc8bbe0, mju_mulQuat allows in-place computations.
There were a few places where the result was unnecessarily assigned to a temporary variable.

PiperOrigin-RevId: 477746005
Change-Id: I7351ef4796e7d70a4a54b930037bfaadee781f12
This commit is contained in:
Nimrod Gileadi
2022-09-29 09:33:12 -07:00
committed by Copybara-Service
parent 48f2ed99a5
commit 8a8305d3ca
5 changed files with 11 additions and 15 deletions
+1 -2
View File
@@ -90,8 +90,7 @@ static void add_noise(const mjModel* m, mjData* d, mjtStage stage) {
// quaternion
else if (m->sensor_datatype[i]==mjDATATYPE_QUATERNION) {
// apply quaternion rotation to quaternion, assign
mju_mulQuat(res, d->sensordata+adr, quat);
mju_copy4(d->sensordata+adr, res);
mju_mulQuat(d->sensordata+adr, d->sensordata+adr, quat);
}
// unknown datatype