From 709719911eb4323879f262829659c6d38493f4bc Mon Sep 17 00:00:00 2001 From: Kyle Bayes Date: Tue, 26 Mar 2024 03:18:21 -0700 Subject: [PATCH] Make SameVector return early. PiperOrigin-RevId: 619128273 Change-Id: Ic47613b8322b9ff5a6a1f557cc9626a20aaee794 --- src/xml/xml_util.cc | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/xml/xml_util.cc b/src/xml/xml_util.cc index fcda1791..d5250cbc 100644 --- a/src/xml/xml_util.cc +++ b/src/xml/xml_util.cc @@ -523,14 +523,13 @@ bool mjXUtil::SameVector(const T* vec1, const T* vec2, int n) { return false; } - bool same = true; - for (int i=0; i std::numeric_limits::epsilon()) { - same = false; + return false; } } - return same; + return true; } template bool mjXUtil::SameVector(const double* vec1, const double* vec2, int n);