From a132a36ff2d5a90aeb7ffe1ec7e1109ed4e4570e Mon Sep 17 00:00:00 2001 From: Frank Dellaert Date: Sat, 28 Jan 2023 12:57:47 -0800 Subject: [PATCH] Avoid warning --- gtsam/slam/InitializePose3.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/gtsam/slam/InitializePose3.cpp b/gtsam/slam/InitializePose3.cpp index e8ec9181c..3e2ad7ebe 100644 --- a/gtsam/slam/InitializePose3.cpp +++ b/gtsam/slam/InitializePose3.cpp @@ -206,11 +206,10 @@ Values InitializePose3::computeOrientationsGradient( // Return correct rotations const Rot3& Rref = inverseRot.at(initialize::kAnchorKey); // This will be set to the identity as so far we included no prior Values estimateRot; - for (const auto key_R : inverseRot) { + for (const auto& key_R : inverseRot) { const Key& key = key_R.first; - const Rot3& Ri = key_R.second; if (key != initialize::kAnchorKey) { - const Rot3& R = inverseRot.at(key); + const Rot3& R = key_R.second; if(setRefFrame) estimateRot.insert(key, Rref.compose(R.inverse())); else