summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCharlie Swanson <charlie.swanson@mongodb.com>2018-02-15 15:33:51 -0500
committerCharlie Swanson <charlie.swanson@mongodb.com>2018-02-27 11:16:08 -0500
commitf5c2680d3e3f28f4e32e2f5fbbbc61c39d55c2c8 (patch)
tree0e1ed88a312d16ad7a01e51f925e9cb371f1ca23
parente3f361769cd13ba88aa24c1c0a71c76b187f64dd (diff)
downloadmongo-f5c2680d3e3f28f4e32e2f5fbbbc61c39d55c2c8.tar.gz
SERVER-33358 Inline dassert boolean in ClientCursorPin
The check of the lock state was showing up in a performance trace of a non-debug build.
-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);