summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/mongo/db/clientcursor.cpp10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/mongo/db/clientcursor.cpp b/src/mongo/db/clientcursor.cpp
index 3b0f6b4d297..ff3a3cba0c0 100644
--- a/src/mongo/db/clientcursor.cpp
+++ b/src/mongo/db/clientcursor.cpp
@@ -209,9 +209,8 @@ void ClientCursorPin::release() {
// Note it's not safe to dereference _cursor->_cursorManager unless we know we haven't been
// killed. If we're not locked we assume we haven't been killed because we're working with the
// global cursor manager which never kills cursors.
- const bool isLocked =
- _opCtx->lockState()->isCollectionLockedForMode(_cursor->_nss.ns(), MODE_IS);
- dassert(isLocked || _cursor->_cursorManager->isGlobalManager());
+ dassert(_opCtx->lockState()->isCollectionLockedForMode(_cursor->_nss.ns(), MODE_IS) ||
+ _cursor->_cursorManager->isGlobalManager());
invariant(_cursor->_operationUsingCursor);
@@ -242,9 +241,8 @@ void ClientCursorPin::deleteUnderlying() {
// Note it's not safe to dereference _cursor->_cursorManager unless we know we haven't been
// killed. If we're not locked we assume we haven't been killed because we're working with the
// global cursor manager which never kills cursors.
- const bool isLocked =
- _opCtx->lockState()->isCollectionLockedForMode(_cursor->_nss.ns(), MODE_IS);
- dassert(isLocked || _cursor->_cursorManager->isGlobalManager());
+ dassert(_opCtx->lockState()->isCollectionLockedForMode(_cursor->_nss.ns(), MODE_IS) ||
+ _cursor->_cursorManager->isGlobalManager());
if (!_cursor->getExecutor()->isMarkedAsKilled()) {
_cursor->_cursorManager->deregisterCursor(_cursor);