Reserve memory for cache

release/4.3a0
Frank Dellaert 2019-04-08 16:51:39 -04:00
parent 50d9e1ef1c
commit 1a862c24a6
1 changed files with 1 additions and 0 deletions

View File

@ -658,6 +658,7 @@ Vector getSubvector(const Vector &src, const KeyInfo &keyInfo,
const KeyVector &keys) {
/* a cache of starting index and dim */
vector<std::pair<size_t, size_t> > cache;
cache.reserve(3);
/* figure out dimension by traversing the keys */
size_t dim = 0;