diff --git a/arangod/VocBase/vocbase.cpp b/arangod/VocBase/vocbase.cpp index 77ce9c6e54..07419e6ab6 100644 --- a/arangod/VocBase/vocbase.cpp +++ b/arangod/VocBase/vocbase.cpp @@ -837,9 +837,9 @@ std::vector TRI_vocbase_t::collectionNames() { std::vector result; READ_LOCKER(readLocker, _collectionsLock); - - for (auto const& it : _collectionsById) { - result.emplace_back(it.second->name()); + result.reserve(_collectionsByName.size()); + for (auto const& it : _collectionsByName) { + result.emplace_back(it.first); } return result; @@ -1421,7 +1421,10 @@ std::vector TRI_vocbase_t::collections() { { READ_LOCKER(readLocker, _collectionsLock); - collections = _collections; + collections.reserve(_collectionsById.size()); + for (auto const& it : _collectionsById) { + collections.emplace_back(it.second); + } } return collections; }