diff options
author | Andy Schwerin <schwerin@mongodb.com> | 2015-11-20 14:36:38 -0500 |
---|---|---|
committer | Andy Schwerin <schwerin@mongodb.com> | 2015-12-09 13:53:25 -0500 |
commit | dc9993d8df8f6fd38a46549af0ba89564b11328c (patch) | |
tree | 9d5d3db30214abc9d83579269c9913798251d2d2 /src | |
parent | a4d29291cc3ee4d44970fc450e0a7124828394b2 (diff) | |
download | mongo-dc9993d8df8f6fd38a46549af0ba89564b11328c.tar.gz |
SERVER-21382 Remove unused _id-extracting out parameter from Collection::deleteDocument
Diffstat (limited to 'src')
-rw-r--r-- | src/mongo/db/catalog/collection.cpp | 9 | ||||
-rw-r--r-- | src/mongo/db/catalog/collection.h | 3 | ||||
-rw-r--r-- | src/mongo/db/cloner.cpp | 5 | ||||
-rw-r--r-- | src/mongo/db/dbhelpers.cpp | 3 | ||||
-rw-r--r-- | src/mongo/dbtests/query_stage_count.cpp | 2 | ||||
-rw-r--r-- | src/mongo/dbtests/query_stage_sort.cpp | 4 |
6 files changed, 10 insertions, 16 deletions
diff --git a/src/mongo/db/catalog/collection.cpp b/src/mongo/db/catalog/collection.cpp index e7cad0bf046..3be9467c79e 100644 --- a/src/mongo/db/catalog/collection.cpp +++ b/src/mongo/db/catalog/collection.cpp @@ -476,8 +476,10 @@ Status Collection::aboutToDeleteCapped(OperationContext* txn, return Status::OK(); } -void Collection::deleteDocument( - OperationContext* txn, const RecordId& loc, bool cappedOK, bool noWarn, BSONObj* deletedId) { +void Collection::deleteDocument(OperationContext* txn, + const RecordId& loc, + bool cappedOK, + bool noWarn) { if (isCapped() && !cappedOK) { log() << "failing remove on a capped ns " << _ns << endl; uasserted(10089, "cannot remove from a capped collection"); @@ -490,9 +492,6 @@ void Collection::deleteDocument( BSONObj id; if (e.type()) { id = e.wrap(); - if (deletedId) { - *deletedId = e.wrap(); - } } /* check if any cursors point to us. if so, advance them. */ diff --git a/src/mongo/db/catalog/collection.h b/src/mongo/db/catalog/collection.h index 1ba17ee3ba4..5db3fe09984 100644 --- a/src/mongo/db/catalog/collection.h +++ b/src/mongo/db/catalog/collection.h @@ -246,8 +246,7 @@ public: void deleteDocument(OperationContext* txn, const RecordId& loc, bool cappedOK = false, - bool noWarn = false, - BSONObj* deletedId = 0); + bool noWarn = false); /* * Inserts all documents inside one WUOW. diff --git a/src/mongo/db/cloner.cpp b/src/mongo/db/cloner.cpp index 2d483b55715..b3b128b89ab 100644 --- a/src/mongo/db/cloner.cpp +++ b/src/mongo/db/cloner.cpp @@ -659,10 +659,7 @@ Status Cloner::copyDb(OperationContext* txn, // dupsAllowed in IndexCatalog::_unindexRecord and SERVER-17487. for (set<RecordId>::const_iterator it = dups.begin(); it != dups.end(); ++it) { WriteUnitOfWork wunit(txn); - BSONObj id; - - c->deleteDocument( - txn, *it, true, true, txn->writesAreReplicated() ? &id : nullptr); + c->deleteDocument(txn, *it, true, true); wunit.commit(); } diff --git a/src/mongo/db/dbhelpers.cpp b/src/mongo/db/dbhelpers.cpp index 7aa66d7facd..b68c232048f 100644 --- a/src/mongo/db/dbhelpers.cpp +++ b/src/mongo/db/dbhelpers.cpp @@ -429,8 +429,7 @@ long long Helpers::removeRange(OperationContext* txn, if (callback) callback->goingToDelete(obj); - BSONObj deletedId; - collection->deleteDocument(txn, rloc, false, false, &deletedId); + collection->deleteDocument(txn, rloc); wuow.commit(); numDeleted++; } diff --git a/src/mongo/dbtests/query_stage_count.cpp b/src/mongo/dbtests/query_stage_count.cpp index 9065c880ff6..3dd676a878a 100644 --- a/src/mongo/dbtests/query_stage_count.cpp +++ b/src/mongo/dbtests/query_stage_count.cpp @@ -109,7 +109,7 @@ public: void remove(const RecordId& loc) { WriteUnitOfWork wunit(&_txn); - _coll->deleteDocument(&_txn, loc, false, false, NULL); + _coll->deleteDocument(&_txn, loc); wunit.commit(); } diff --git a/src/mongo/dbtests/query_stage_sort.cpp b/src/mongo/dbtests/query_stage_sort.cpp index 64db92f4e22..6560258fd69 100644 --- a/src/mongo/dbtests/query_stage_sort.cpp +++ b/src/mongo/dbtests/query_stage_sort.cpp @@ -457,7 +457,7 @@ public: set<RecordId>::iterator it = locs.begin(); { WriteUnitOfWork wuow(&_txn); - coll->deleteDocument(&_txn, *it++, false, false, NULL); + coll->deleteDocument(&_txn, *it++); wuow.commit(); } exec->restoreState(); @@ -473,7 +473,7 @@ public: while (it != locs.end()) { { WriteUnitOfWork wuow(&_txn); - coll->deleteDocument(&_txn, *it++, false, false, NULL); + coll->deleteDocument(&_txn, *it++); wuow.commit(); } } |