From 5f1daf7ae39e41ae4aa69cca4add602aa1b0b909 Mon Sep 17 00:00:00 2001 From: Lei Jin Date: Tue, 22 Apr 2014 21:14:25 -0700 Subject: [PATCH] get rid of shared_ptr in memtable.cc Summary: Get rid of the devil. Probably won't impact anything on the perf side. Test Plan: make all check Reviewers: igor, haobo, sdong, yhchiang Reviewed By: haobo CC: leveldb, dhruba Differential Revision: https://reviews.facebook.net/D18153 --- db/memtable.cc | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/db/memtable.cc b/db/memtable.cc index 2d12708c3..902a58fa9 100644 --- a/db/memtable.cc +++ b/db/memtable.cc @@ -162,7 +162,6 @@ class MemTableIterator: public Iterator { MemTableIterator(const MemTable& mem, const ReadOptions& options) : bloom_(nullptr), prefix_extractor_(mem.prefix_extractor_), - iter_(), valid_(false) { if (options.prefix) { iter_.reset(mem.table_->GetPrefixIterator(*options.prefix)); @@ -217,7 +216,7 @@ class MemTableIterator: public Iterator { private: DynamicBloom* bloom_; const SliceTransform* const prefix_extractor_; - std::shared_ptr iter_; + std::unique_ptr iter_; bool valid_; // No copying allowed @@ -477,7 +476,7 @@ bool MemTable::UpdateCallback(SequenceNumber seq, LookupKey lkey(key, seq); Slice memkey = lkey.memtable_key(); - std::shared_ptr iter( + std::unique_ptr iter( table_->GetIterator(lkey.user_key())); iter->Seek(lkey.internal_key(), memkey.data());