From 9123d2d3263ea56d8651ba9d4cf5ad1158d939cb Mon Sep 17 00:00:00 2001 From: Kaloian Manassiev Date: Mon, 21 Sep 2015 11:08:06 -0400 Subject: SERVER-18084 Remove usages of ShardingState::get(globalOperationContext()) So that call can be removed in place of the variant, which accepts OperationContext. --- src/mongo/db/commands/create_indexes.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/mongo/db/commands/create_indexes.cpp') diff --git a/src/mongo/db/commands/create_indexes.cpp b/src/mongo/db/commands/create_indexes.cpp index 74c4eeb7a54..604ddaf7ac8 100644 --- a/src/mongo/db/commands/create_indexes.cpp +++ b/src/mongo/db/commands/create_indexes.cpp @@ -295,10 +295,11 @@ private: const BSONObj& newIdxKey) { invariant(txn->lockState()->isCollectionLockedForMode(ns, MODE_X)); - if (ShardingState::get(getGlobalServiceContext())->enabled()) { + ShardingState* const shardingState = ShardingState::get(txn); + + if (shardingState->enabled()) { std::shared_ptr metadata( - ShardingState::get(getGlobalServiceContext()) - ->getCollectionMetadata(ns.toString())); + shardingState->getCollectionMetadata(ns.toString())); if (metadata) { ShardKeyPattern shardKeyPattern(metadata->getKeyPattern()); if (!shardKeyPattern.isUniqueIndexCompatible(newIdxKey)) { -- cgit v1.2.1