summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Morrow <acm@mongodb.com>2016-08-15 12:30:46 -0400
committerAndrew Morrow <acm@mongodb.com>2017-04-17 21:17:12 -0400
commit644c8130839d046599d254fded7da491b69b8289 (patch)
treec691afebb59415308857bbb1af5b4206f1cf8bc7
parent01f3ea709b47de751f2927e0e6a0b9a919ad3b09 (diff)
downloadmongo-644c8130839d046599d254fded7da491b69b8289.tar.gz
SERVER-25385 Eliminate checks of this against nullptr
The compiler is free to eliminate them anyway, as it would have required UB to reach the check. (cherry picked from commit b9f8113e7f346f1449193834b77dc22fa4b1d8c7)
-rw-r--r--src/mongo/client/dbclientcursor.cpp3
-rw-r--r--src/mongo/client/dbclientcursor.h7
-rw-r--r--src/mongo/db/storage/mmap_v1/catalog/namespace_details.cpp1
3 files changed, 0 insertions, 11 deletions
diff --git a/src/mongo/client/dbclientcursor.cpp b/src/mongo/client/dbclientcursor.cpp
index 2e0a5bdade3..d76277d49ca 100644
--- a/src/mongo/client/dbclientcursor.cpp
+++ b/src/mongo/client/dbclientcursor.cpp
@@ -324,8 +324,6 @@ void DBClientCursor::dataReceived(bool& retry, string& host) {
/** If true, safe to call next(). Requests more from server if necessary. */
bool DBClientCursor::more() {
- _assertIfNull();
-
if (!_putBack.empty())
return true;
@@ -343,7 +341,6 @@ bool DBClientCursor::more() {
}
BSONObj DBClientCursor::next() {
- DEV _assertIfNull();
if (!_putBack.empty()) {
BSONObj ret = _putBack.top();
_putBack.pop();
diff --git a/src/mongo/client/dbclientcursor.h b/src/mongo/client/dbclientcursor.h
index a085d90dbd9..a0d9d5e00b5 100644
--- a/src/mongo/client/dbclientcursor.h
+++ b/src/mongo/client/dbclientcursor.h
@@ -70,7 +70,6 @@ public:
then perhaps stop.
*/
int objsLeftInBatch() const {
- _assertIfNull();
return _putBack.size() + batch.nReturned - batch.pos;
}
bool moreInCurrentBatch() {
@@ -143,7 +142,6 @@ public:
ResultFlag_ErrSet is the possible exception to that
*/
bool hasResultFlag(int flag) {
- _assertIfNull();
return (resultFlags & flag) != 0;
}
@@ -290,11 +288,6 @@ private:
void requestMore();
- // Don't call from a virtual function
- void _assertIfNull() const {
- uassert(13348, "connection died", this);
- }
-
// init pieces
void _assembleInit(Message& toSend);
};
diff --git a/src/mongo/db/storage/mmap_v1/catalog/namespace_details.cpp b/src/mongo/db/storage/mmap_v1/catalog/namespace_details.cpp
index 915e3a7e44d..b8139cf7e89 100644
--- a/src/mongo/db/storage/mmap_v1/catalog/namespace_details.cpp
+++ b/src/mongo/db/storage/mmap_v1/catalog/namespace_details.cpp
@@ -97,7 +97,6 @@ NamespaceDetails::Extra* NamespaceDetails::allocExtra(OperationContext* txn,
Namespace fullns(ns);
Namespace extrans(fullns.extraName(i)); // throws UserException if ns name too long
- massert(10350, "allocExtra: base ns missing?", this);
massert(10351, "allocExtra: extra already exists", ni.details(extrans) == 0);
Extra temp;