From 1a862c24a699487a627ffa790a4e246b7a3066bf Mon Sep 17 00:00:00 2001 From: Frank Dellaert Date: Mon, 8 Apr 2019 16:51:39 -0400 Subject: [PATCH] Reserve memory for cache --- gtsam/linear/SubgraphPreconditioner.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/gtsam/linear/SubgraphPreconditioner.cpp b/gtsam/linear/SubgraphPreconditioner.cpp index 657846f95..9578d45bd 100644 --- a/gtsam/linear/SubgraphPreconditioner.cpp +++ b/gtsam/linear/SubgraphPreconditioner.cpp @@ -658,6 +658,7 @@ Vector getSubvector(const Vector &src, const KeyInfo &keyInfo, const KeyVector &keys) { /* a cache of starting index and dim */ vector > cache; + cache.reserve(3); /* figure out dimension by traversing the keys */ size_t dim = 0;