diff options
author | Charlie Swanson <charlie.swanson@mongodb.com> | 2016-09-07 14:05:51 -0400 |
---|---|---|
committer | Charlie Swanson <charlie.swanson@mongodb.com> | 2016-09-13 17:46:37 -0400 |
commit | e41a6af318925f48e5626dd36a17531183e5aac2 (patch) | |
tree | 0b0c3cf4ae1e89030e77c31a8eb35db80d9c0115 /src/mongo/db/pipeline/dependencies.h | |
parent | af0be10862e7a9643586fc2bd1898189a2a6c8cb (diff) | |
download | mongo-e41a6af318925f48e5626dd36a17531183e5aac2.tar.gz |
SERVER-25950 Improve efficiency of Dependencies::extractFields()
Diffstat (limited to 'src/mongo/db/pipeline/dependencies.h')
-rw-r--r-- | src/mongo/db/pipeline/dependencies.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/mongo/db/pipeline/dependencies.h b/src/mongo/db/pipeline/dependencies.h index f3e8e7e6f65..9afd9adbaec 100644 --- a/src/mongo/db/pipeline/dependencies.h +++ b/src/mongo/db/pipeline/dependencies.h @@ -100,8 +100,9 @@ public: private: friend struct DepsTracker; // so it can call constructor - explicit ParsedDeps(const Document& fields) : _fields(fields) {} + explicit ParsedDeps(Document&& fields) : _fields(std::move(fields)), _nFields(_fields.size()) {} Document _fields; + int _nFields; // Cache the number of top-level fields needed. }; } |