summaryrefslogtreecommitdiff
path: root/src/mongo/s/shard_key_pattern.cpp
diff options
context:
space:
mode:
authorMax Hirschhorn <max.hirschhorn@mongodb.com>2016-02-12 11:03:58 -0500
committerMax Hirschhorn <max.hirschhorn@mongodb.com>2016-02-12 11:03:58 -0500
commit4f1cc51f3e21e4ff76c68e86ecae4e5d138de0aa (patch)
treeed0d7c3dc2d60437d7997c277dfa4912ffa107ff /src/mongo/s/shard_key_pattern.cpp
parentdb403d46d2ed98a3600410d90ef3deee8901bed6 (diff)
downloadmongo-4f1cc51f3e21e4ff76c68e86ecae4e5d138de0aa.tar.gz
SERVER-22569 Change findParentEqualityElement() to return by value.
MSVC 2013 doesn't support thread-safe initialization of function-local static-duration objects, so it's possible to return a reference to 'eooElement' prior to the value being fully initialized.
Diffstat (limited to 'src/mongo/s/shard_key_pattern.cpp')
-rw-r--r--src/mongo/s/shard_key_pattern.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/mongo/s/shard_key_pattern.cpp b/src/mongo/s/shard_key_pattern.cpp
index 67d2743ac22..5a30cff8fb3 100644
--- a/src/mongo/s/shard_key_pattern.cpp
+++ b/src/mongo/s/shard_key_pattern.cpp
@@ -247,7 +247,7 @@ BSONObj ShardKeyPattern::extractShardKeyFromDoc(const BSONObj& doc) const {
static BSONElement findEqualityElement(const EqualityMatches& equalities, const FieldRef& path) {
int parentPathPart;
- const BSONElement& parentEl =
+ const BSONElement parentEl =
pathsupport::findParentEqualityElement(equalities, path, &parentPathPart);
if (parentPathPart == static_cast<int>(path.numParts()))