Skip to content

Commit

Permalink
Revert to copy
Browse files Browse the repository at this point in the history
Signed-off-by: Yang Zhang <[email protected]>
  • Loading branch information
v01dstar committed Jan 3, 2024
1 parent 83d2939 commit cb9cb1c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
11 changes: 4 additions & 7 deletions db/column_family.cc
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,10 @@ ColumnFamilyHandleImpl::ColumnFamilyHandleImpl(
}
}

ColumnFamilyHandleImpl::ColumnFamilyHandleImpl(ColumnFamilyHandleImpl&& other) {
cfd_ = other.cfd_;
db_ = other.db_;
mutex_ = other.mutex_;
other.cfd_ = nullptr;
other.db_ = nullptr;
other.mutex_ = nullptr;
ColumnFamilyHandleImpl::ColumnFamilyHandleImpl(
const ColumnFamilyHandleImpl& other)
: cfd_(other.cfd_), db_(other.db_), mutex_(other.mutex_) {
cfd_->Ref();
}

ColumnFamilyHandleImpl::~ColumnFamilyHandleImpl() {
Expand Down
2 changes: 1 addition & 1 deletion db/column_family.h
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ class ColumnFamilyHandleImpl : public ColumnFamilyHandle {
// create while holding the mutex
ColumnFamilyHandleImpl(
ColumnFamilyData* cfd, DBImpl* db, InstrumentedMutex* mutex);
ColumnFamilyHandleImpl(ColumnFamilyHandleImpl&& other);
ColumnFamilyHandleImpl(const ColumnFamilyHandleImpl& other);
// destroy without mutex
virtual ~ColumnFamilyHandleImpl();
virtual ColumnFamilyData* cfd() const { return cfd_; }
Expand Down

0 comments on commit cb9cb1c

Please sign in to comment.