diff options
author | Ian Boros <ian.boros@mongodb.com> | 2020-04-01 22:02:17 -0400 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2020-04-13 20:35:43 +0000 |
commit | e95c1625acdaed28ddb9ebda5c293e307e8ee284 (patch) | |
tree | 133bd2aa95e4df318f541d93b41511e6abaf987a /src/mongo/db/pipeline/expression_context.h | |
parent | 88c3019bb204ac8a5f30304c7e94f09d30a5d0c8 (diff) | |
download | mongo-e95c1625acdaed28ddb9ebda5c293e307e8ee284.tar.gz |
SERVER-47328 optimize MR by avoiding repeated creation of RuntimeConstants
Diffstat (limited to 'src/mongo/db/pipeline/expression_context.h')
-rw-r--r-- | src/mongo/db/pipeline/expression_context.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/mongo/db/pipeline/expression_context.h b/src/mongo/db/pipeline/expression_context.h index 96f9f538837..cbb0aab0c4b 100644 --- a/src/mongo/db/pipeline/expression_context.h +++ b/src/mongo/db/pipeline/expression_context.h @@ -257,7 +257,7 @@ public: _resolvedNamespaces = std::move(resolvedNamespaces); } - auto getRuntimeConstants() const { + const RuntimeConstants& getRuntimeConstants() const { return variables.getRuntimeConstants(); } @@ -273,7 +273,7 @@ public: uassert(31264, "Cannot run server-side javascript without the javascript engine enabled", getGlobalScriptEngine()); - RuntimeConstants runtimeConstants = getRuntimeConstants(); + const auto& runtimeConstants = getRuntimeConstants(); const boost::optional<bool> isMapReduceCommand = runtimeConstants.getIsMapReduce(); if (inMongos) { invariant(!forceLoadOfStoredProcedures); |