diff options
author | Andrew Morrow <acm@10gen.com> | 2013-12-23 13:47:43 -0500 |
---|---|---|
committer | Andrew Morrow <acm@10gen.com> | 2014-01-04 14:55:32 -0500 |
commit | 1d0ac3e882c6323fc99fb98c861629caf8e3918e (patch) | |
tree | 6f85560b0bf62178299d14a131838b2b05741b7a /src/mongo/db/ops/update_lifecycle_impl.cpp | |
parent | 344b86426595713e32fefa2e5a627988b04529fb (diff) | |
download | mongo-1d0ac3e882c6323fc99fb98c861629caf8e3918e.tar.gz |
SERVER-10159 Re-use Collection and index data structures rather than re-acquiring or copying
Diffstat (limited to 'src/mongo/db/ops/update_lifecycle_impl.cpp')
-rw-r--r-- | src/mongo/db/ops/update_lifecycle_impl.cpp | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/src/mongo/db/ops/update_lifecycle_impl.cpp b/src/mongo/db/ops/update_lifecycle_impl.cpp index 9564d66b2e8..41ec120a31d 100644 --- a/src/mongo/db/ops/update_lifecycle_impl.cpp +++ b/src/mongo/db/ops/update_lifecycle_impl.cpp @@ -52,16 +52,19 @@ namespace mongo { ChunkVersion::IGNORED()) { } - const bool UpdateLifecycleImpl::canContinue() const { + void UpdateLifecycleImpl::setCollection(Collection* collection) { + _collection = collection; + } + + bool UpdateLifecycleImpl::canContinue() const { // Collection needs to exist to continue - Collection* coll = cc().database()->getCollection(_nsString.ns()); - return coll; + return _collection; } - const void UpdateLifecycleImpl::getIndexKeys(IndexPathSet* returnedIndexPathSet) const { - Collection* coll = cc().database()->getCollection(_nsString.ns()); - if (coll) - *returnedIndexPathSet = coll->infoCache()->indexKeys(); + const IndexPathSet* UpdateLifecycleImpl::getIndexKeys() const { + if (_collection) + return &_collection->infoCache()->indexKeys(); + return NULL; } const std::vector<FieldRef*>* UpdateLifecycleImpl::getImmutableFields() const { |