Make SameVector return early.
PiperOrigin-RevId: 619128273 Change-Id: Ic47613b8322b9ff5a6a1f557cc9626a20aaee794
This commit is contained in:
committed by
Copybara-Service
parent
357ff8bbdc
commit
709719911e
+3
-4
@@ -523,14 +523,13 @@ bool mjXUtil::SameVector(const T* vec1, const T* vec2, int n) {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool same = true;
|
for (int i = 0; i < n; i++) {
|
||||||
for (int i=0; i<n; i++) {
|
|
||||||
if (std::abs(vec1[i] - vec2[i]) > std::numeric_limits<T>::epsilon()) {
|
if (std::abs(vec1[i] - vec2[i]) > std::numeric_limits<T>::epsilon()) {
|
||||||
same = false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return same;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
template bool mjXUtil::SameVector(const double* vec1, const double* vec2, int n);
|
template bool mjXUtil::SameVector(const double* vec1, const double* vec2, int n);
|
||||||
|
|||||||
Reference in New Issue
Block a user