summaryrefslogtreecommitdiff
path: root/src/mongo/db/service_context.cpp
diff options
context:
space:
mode:
authorJason Carey <jcarey@argv.me>2019-02-25 17:19:17 -0500
committerJason Carey <jcarey@argv.me>2019-02-26 13:41:37 -0500
commite61f7582788f51b2287f179c8f27ec8fa41744f7 (patch)
tree4782266e9272ef7cd005629adf1a4b18b5b10f84 /src/mongo/db/service_context.cpp
parent4365d1c27c42ff64f815a2a4df9d6a7f94d37592 (diff)
downloadmongo-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.cpp4
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();