diff options
author | James Wahlin <james.wahlin@10gen.com> | 2015-09-17 16:16:56 -0400 |
---|---|---|
committer | James Wahlin <james.wahlin@10gen.com> | 2015-09-18 14:20:55 -0400 |
commit | 1aec175308cb91b43efd6bafc145054222db7748 (patch) | |
tree | 113ee28a29a962a31a62134ad536d3efb0d6dcd6 /src/mongo/db/storage/bson_collection_catalog_entry.cpp | |
parent | 523f9389dafb53151800cf6f17b3d6a7d4fbfebe (diff) | |
download | mongo-1aec175308cb91b43efd6bafc145054222db7748.tar.gz |
SERVER-20327 Don't copy indexes catalog entry to array before parsing
Diffstat (limited to 'src/mongo/db/storage/bson_collection_catalog_entry.cpp')
-rw-r--r-- | src/mongo/db/storage/bson_collection_catalog_entry.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/mongo/db/storage/bson_collection_catalog_entry.cpp b/src/mongo/db/storage/bson_collection_catalog_entry.cpp index 976636b0bc6..9a07ed8295e 100644 --- a/src/mongo/db/storage/bson_collection_catalog_entry.cpp +++ b/src/mongo/db/storage/bson_collection_catalog_entry.cpp @@ -175,11 +175,11 @@ void BSONCollectionCatalogEntry::MetaData::parse(const BSONObj& obj) { options.parse(obj["options"].Obj()); } - BSONElement e = obj["indexes"]; - if (e.isABSONObj()) { - std::vector<BSONElement> entries = e.Array(); - for (unsigned i = 0; i < entries.size(); i++) { - BSONObj idx = entries[i].Obj(); + BSONElement indexList = obj["indexes"]; + + if (indexList.isABSONObj()) { + for (BSONElement elt : indexList.Obj()) { + BSONObj idx = elt.Obj(); IndexMetaData imd; imd.spec = idx["spec"].Obj().getOwned(); imd.ready = idx["ready"].trueValue(); |