diff --git a/gtsam/linear/HessianFactor.cpp b/gtsam/linear/HessianFactor.cpp index 1b0a10fee..db943aa70 100644 --- a/gtsam/linear/HessianFactor.cpp +++ b/gtsam/linear/HessianFactor.cpp @@ -131,14 +131,15 @@ HessianFactor::HessianFactor(Key j1, Key j2, Key j3, const Matrix& G11, } /* ************************************************************************* */ -std::vector _getSizeHFVec(const std::vector& m) { +namespace { +static std::vector _getSizeHFVec(const std::vector& m) { std::vector dims; for (const Vector& v : m) { dims.push_back(v.size()); } return dims; } -} +} // namespace /* ************************************************************************* */ HessianFactor::HessianFactor(const KeyVector& js, @@ -409,9 +410,7 @@ void HessianFactor::multiplyHessianAdd(double alpha, const VectorValues& x, // copy to yvalues for (DenseIndex i = 0; i < (DenseIndex) size(); ++i) { - bool didNotExist; - VectorValues::iterator it; - std::tie(it, didNotExist) = yvalues.tryInsert(keys_[i], Vector()); + const auto [it, didNotExist] = yvalues.tryInsert(keys_[i], Vector()); if (didNotExist) it->second = alpha * y[i]; // init else