Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions database/src/android/mutable_data_android.cc
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,6 @@ MutableDataInternal::~MutableDataInternal() {
}
}

MutableDataInternal* MutableDataInternal::Clone() {
return new MutableDataInternal(db_, obj_);
}

bool MutableDataInternal::Initialize(App* app) {
JNIEnv* env = app->GetJNIEnv();
jobject activity = app->activity();
Expand Down
4 changes: 0 additions & 4 deletions database/src/android/mutable_data_android.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,6 @@ class MutableDataInternal {
public:
~MutableDataInternal();

// Create a shallow copy of the MutableData.
// The caller owns the returned pointer and is responsible for deleting it.
MutableDataInternal* Clone();

// Used to obtain a MutableData instance that encapsulates the data and
// priority at the given relative path.
MutableDataInternal* Child(const char* path);
Expand Down
13 changes: 0 additions & 13 deletions database/src/common/mutable_data.cc
Original file line number Diff line number Diff line change
Expand Up @@ -52,19 +52,6 @@ MutableData::MutableData(MutableDataInternal* internal) : internal_(internal) {
CleanupFnMutableData::Register(this, internal_);
}

MutableData::MutableData(const MutableData& rhs)
: internal_(rhs.internal_ ? rhs.internal_->Clone() : nullptr) {
CleanupFnMutableData::Register(this, internal_);
}

MutableData& MutableData::operator=(const MutableData& rhs) {
CleanupFnMutableData::Unregister(this, internal_);
if (internal_) delete internal_;
internal_ = rhs.internal_ ? rhs.internal_->Clone() : nullptr;
CleanupFnMutableData::Register(this, internal_);
return *this;
}

#if defined(FIREBASE_USE_MOVE_OPERATORS)
MutableData::MutableData(MutableData&& rhs) : internal_(rhs.internal_) {
rhs.internal_ = nullptr;
Expand Down
5 changes: 0 additions & 5 deletions database/src/desktop/mutable_data_desktop.cc
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,6 @@ MutableDataInternal::MutableDataInternal(const MutableDataInternal& other,
const Path& path)
: db_(other.db_), path_(path), holder_(other.holder_) {}

MutableDataInternal* MutableDataInternal::Clone() {
// Just use the copy constructor
return new MutableDataInternal(*this);
}

MutableDataInternal* MutableDataInternal::Child(const char* path) {
return new MutableDataInternal(*this, path_.GetChild(path));
}
Expand Down
5 changes: 1 addition & 4 deletions database/src/desktop/mutable_data_desktop.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,6 @@ class MutableDataInternal {
// This constructor is used when creating the original copy of MutableData
explicit MutableDataInternal(DatabaseInternal* database, const Variant& data);

// Create a shallow copy of the MutableData.
// The caller owns the returned pointer and is responsible for deleting it.
MutableDataInternal* Clone();

// Used to obtain a MutableData instance that encapsulates the data and
// priority at the given relative path.
MutableDataInternal* Child(const char* path);
Expand Down Expand Up @@ -90,6 +86,7 @@ class MutableDataInternal {
const Path& path);

DatabaseInternal* db_;

// Path relative to the root of holder_
Path path_;

Expand Down
16 changes: 3 additions & 13 deletions database/src/include/firebase/database/mutable_data.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,19 +34,6 @@ class Repo;
#endif // SWIG
class MutableData {
public:
/// @brief Copy constructor.
///
/// This only makes a shallow copy and copies of MutableData will share the
/// same internal data. I.e. changes to one copy will appear in the other.
/// The main reason the copy constructor is provided is to allow the Child
/// method to return a MutableData by value.
MutableData(const MutableData& rhs);

/// @brief Copy assignment operator
///
/// @deprecated MutableData is not supposed to be assigned.
FIREBASE_DEPRECATED MutableData& operator=(const MutableData& rhs);

#if defined(FIREBASE_USE_MOVE_OPERATORS)
/// Move constructor
/// Move is more efficient than copy and delete.
Expand Down Expand Up @@ -166,6 +153,9 @@ class MutableData {

explicit MutableData(internal::MutableDataInternal* internal);

MutableData(const MutableData& rhs) = delete;
MutableData& operator=(const MutableData& rhs) = delete;

internal::MutableDataInternal* internal_;
};

Expand Down
4 changes: 0 additions & 4 deletions database/src/ios/mutable_data_ios.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,6 @@ class MutableDataInternal {
public:
~MutableDataInternal();

// Create a shallow copy of the MutableData.
// The caller owns the returned pointer and is responsible for deleting it.
MutableDataInternal* Clone();

// Used to obtain a MutableData instance that encapsulates the data and
// priority at the given relative path.
MutableDataInternal* Child(const char* path);
Expand Down
4 changes: 0 additions & 4 deletions database/src/ios/mutable_data_ios.mm
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,6 @@

MutableDataInternal::~MutableDataInternal() {}

MutableDataInternal* MutableDataInternal::Clone() {
return new MutableDataInternal(db_, MakeUnique<FIRMutableDataPointer>(impl()));
}

MutableDataInternal* MutableDataInternal::Child(const char* path) {
return new MutableDataInternal(
db_, MakeUnique<FIRMutableDataPointer>([impl() childDataByAppendingPath:@(path)]));
Expand Down