diff options
author | Jason Carey <jcarey@argv.me> | 2019-02-25 17:19:17 -0500 |
---|---|---|
committer | Jason Carey <jcarey@argv.me> | 2019-02-26 13:41:37 -0500 |
commit | e61f7582788f51b2287f179c8f27ec8fa41744f7 (patch) | |
tree | 4782266e9272ef7cd005629adf1a4b18b5b10f84 /src/mongo/db/service_context.cpp | |
parent | 4365d1c27c42ff64f815a2a4df9d6a7f94d37592 (diff) | |
download | mongo-e61f7582788f51b2287f179c8f27ec8fa41744f7.tar.gz |
SERVER-39303 Fix several useless Client* checks
The checks performed in functions that are never passed a nullptr and
would crash later if null was ever passed. Removing the checks makes
coverity happy.
Diffstat (limited to 'src/mongo/db/service_context.cpp')
-rw-r--r-- | src/mongo/db/service_context.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/mongo/db/service_context.cpp b/src/mongo/db/service_context.cpp index 4d9d218a200..ee26756a642 100644 --- a/src/mongo/db/service_context.cpp +++ b/src/mongo/db/service_context.cpp @@ -236,7 +236,7 @@ void ServiceContext::ClientDeleter::operator()(Client* client) const { ServiceContext::UniqueOperationContext ServiceContext::makeOperationContext(Client* client) { auto opCtx = std::make_unique<OperationContext>(client, _nextOpId.fetchAndAdd(1)); - if (client && client->session()) { + if (client->session()) { _numCurrentOps.addAndFetch(1); } @@ -264,7 +264,7 @@ void ServiceContext::OperationContextDeleter::operator()(OperationContext* opCtx opCtx->getBaton()->detach(); auto client = opCtx->getClient(); - if (client && client->session()) { + if (client->session()) { _numCurrentOps.subtractAndFetch(1); } auto service = client->getServiceContext(); |